+ 1
What does AsEnumerable() do for Dbset classes
So I'm trying to retrieve data from a database through a database context, but when I'm trying to filter with only Where(), it throws an error Here's the code: using (var context = new DbContext()) { var adults = context.People //.AsEnumerable() .Where(x => x.Age >= 18); }
2 ответов
+ 1
AsEnumerable down casts to IEnumerable and causes the following query operators (.Where...) to bind to an enumerable operator instead.
This makes subsequent query execute locally.
0
DavX, thank you