What is the purpose of the SiteProvider.Articles bit. I dont understand the instantition of an instance piece in the SiteProvider.cs file. Can I eliminate the creation of the instance and just directly execute the GetCategories() method? How would I accomplish
this?
Thanks
You are so wise...like a miniature budha covered in fur. -Anchorman
ok..so i found the default provider in the ConfigSection.cs file...but i still cant figure out how to code the providertype explicitly, can someone show me how to do this please.
So if im strictly using, say SQL, how could I rewrite the ArticlesProvider to create an instance of ArticlesProvider type? I tried this in the Articles Provider class and it didnt work.
spinz2112
Member
214 Points
219 Posts
Siteprovider
Sep 07, 2008 09:02 AM|LINK
In the BLL in, say, the Category.cs file, where the code reads:
List<CategoryDetails> recordset = SiteProvider.Articles.GetCategories();
categories = GetCategoryListFromCategoryDetailsList(recordset);
BaseArticle.CacheData(key, categories);
What is the purpose of the SiteProvider.Articles bit. I dont understand the instantition of an instance piece in the SiteProvider.cs file. Can I eliminate the creation of the instance and just directly execute the GetCategories() method? How would I accomplish this?
Thanks
spinz2112
Member
214 Points
219 Posts
Re: Siteprovider
Sep 07, 2008 06:14 PM|LINK
ok..so i found the default provider in the ConfigSection.cs file...but i still cant figure out how to code the providertype explicitly, can someone show me how to do this please.
So if im strictly using, say SQL, how could I rewrite the ArticlesProvider to create an instance of ArticlesProvider type? I tried this in the Articles Provider class and it didnt work.
_instance = (ArticlesProvider)Activator.CreateInstance(
Type.GetType(MB.TheBeerHouse.DAL.SQLClient.SqlArticlesProvider));
I get the squiggly line and the error: The best overloaded match for 'System.Activator.CreateInstance' has some invalid arguments.
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Siteprovider
Sep 08, 2008 01:42 PM|LINK
In case anyone is looking for this answer in the future, it is a crosspost from here:
http://p2p.wrox.com/topic.asp?TOPIC_ID=73901
Follow Me on Twitter