System.Data.Entity.DbSet vs System.Data.Entity.Infrastructure.DbQuery

Can someone explain what the difference between the two is in the Entity Framework.

Example 1:

obj = new TicketsEntities();
var depts = obj.DEPARTMENTs.Select( x => x);
string str = depts.GetType().ToString();

In this case, str prints --- System.Data.Entity.Infrastructure.DbQuery`1 [LINQu.Models.DEPARTMENT]

Example 2:

obj = new TicketsEntities();
var depts = obj.DEPARTMENTs;
string str = depts.GetType().ToString();

In this case, str prints --- System.Data.Entity.DbSet`1 [LINQu.Models.DEPARTMENT]

In any case, when we focus on deltas, we get the same result, so what is the difference between them and which one is preferable?

+4
source share
1 answer

DbSet , , "", "", "". DbQuery Linq, . "", "" "".

, , , Select (x = > x) .

+1

All Articles