I’m using a RepositoryBase<T> base class as the foundation for my individual repositories (e.g. UserRepository).
It simplifies things like adding new entities etc. for example:
public IQueryable<T> SelectAll()
{
return db.GetTable<T>().AsQueryable<T>();
}
Now I’ve added a view “UserActive” in my database. Is there any way to access the view in a similar manner, e.g. if T = User then I want to return the db.UsersActive view?
If it’s a special one-off case, you could do:
This of course makes an assumption on how you would access your useractive view using your linq provider 😛 YMMV