interface IEntityProvider<T> where T: BaseEntity
{
T Get(int id);
List<T> GetAll();
}
interface IUserProvider : IEntityProvider(User)
{
User FindByLastName(string lastName);
}
class ProviderFactory<I, T>
where I: IEntityProvider<T>
where T: BaseEntity
{
public static I CreateProvider(){}
}
IUserProvider x = ProviderFactory<IUserProvider, User>.CreateProvider();
User y = x.FindBy...
User[] yy = x.GetAll().ToArray();
I wrote that recently and have a prototype built around it.
Any comments will do I suppose.
Ron
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com