public static PeopleProvider Provider {
get {
Initialize();
return _provider;
}
}
public static List<Person> GetAllPersons()
{
return Provider.GetAllPersons();
}
=========================
There are two GetAllPersons functions in: SqlPeopleProvider.cs and XmlPeopleProvider.cs, how the program knows go to which one? at the moment, it will use the function in: XmlPeopleProvider.cs, it must have some relationship with: Initialize(), but can you
tell me how?
jamest85
Member
264 Points
361 Posts
GetAllPersons()
Sep 18, 2008 10:18 PM|LINK
In People.aspx
===========================
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllPersons"
TypeName="People"></asp:ObjectDataSource>
============================
in Class: People:
============================
public static class People {
private static bool _isInitialized = false;
private static PeopleProvider _provider;
private static SmallBusinessDataProvidersSection _providersSection;
public static PeopleProvider Provider {
get {
Initialize();
return _provider;
}
}
public static List<Person> GetAllPersons()
{
return Provider.GetAllPersons();
}
=========================
There are two GetAllPersons functions in: SqlPeopleProvider.cs and XmlPeopleProvider.cs, how the program knows go to which one? at the moment, it will use the function in: XmlPeopleProvider.cs, it must have some relationship with: Initialize(), but can you tell me how?
Thanks
JT