I donβt think there is a built-in method to achieve this, however you can open the property in your DbContext where you apply filtering, initially it will be read-only, but I see no reason why you should not create your own DbSet Implementation. reflecting a return to another DbSet (ProxyDbSet)
Example using Readonly:
class MyDbContext : DbContext { public IDbSet<User> Users { get; set; } public IQueryable<User> Admins { get { return from user in users where user.Role == "admin" select user; } } }
source share