Following this question / answer
How to make the Entity Framework Data Context read
The solution is to make your DbContext collections of type DbQuery, but it's a pretty specialized type (it's buried in namespaces for EF).
So what is the functional difference between DbContext with this:
public DbQuery<Customer> Customers
{
get { return Set<Customer>().AsNoTracking(); }
}
vs this:
public IQueryable<Customer> Customers
{
get { return Set<Customer>().AsNoTracking(); }
}
... EF documentation is very easy when it comes to the DbQuery class, but I prefer the DbContext to consist of interfaces rather than classes, so I would like to avoid it. What additional benefits does the DbQuery class provide?
Update
, , . , , ! , DbQuery , . , IQueryable - . !