I am just starting with EF, and such a query looks like odd:
var departmentQuery = schoolContext.Departments.Include("Courses"). OrderBy("it.Name");
In particular, what sticks out for me is "it.Name". When I was working with LINQ to SQL, almost every filter in the query builder query could be set using lambda, for example, in this case d => d.Name.
I see that there are OrderBy overrides that accept lambdas that return IOrderedQueryable or IOrderedEnumable, but they obviously don't have the Execute method needed to get the ObjectResult, which can then be bound to the database.
It seems strange to me, after all I read about how lambdas make such a sense for these kinds of things and how they are converted to expression trees and then to the target language - why do I need to use it?. ""
c # entity-framework
nlawalker
source share