Reputation: 2353
Should you add filtering (and e.g. ordering) to the DBSet object or first call DBSet.AsQueryable() or DBSet.AsQueryable()?
In which case do you need to use the next functions?
Context.Set<T>().Where<>
Context.Set<T>().AsQueryable<T>().Where<>
Context.Set<T>().AsQueryable().Where<>
Upvotes: 2
Views: 533
Reputation: 8350
There is no need to call IQueryable
because DBSet<T>
result is already returning as queryable.
For example this:
Context.Set<MyTable>.Where(i => i.itemId == 1) // returns IQueryable<MyTable>
will return a list of IQueryable
results.
Upvotes: 2