Suppose I have the following "Foo" and "Bar" entities:
class Foo {
int FooId;
string FooName;
}
class Bar {
int BarId;
Foo RelatedFoo;
string BarName;
}
Let's also suppose that I want "RelatedFoo" to be lazy-loaded by default.
In Entity Framework, is it possible to do a query that returns an enumerable of "Bar" entities where elements are sorted by "bar.RelatedFoo.FooName"?
If so, can this be done in a fixed number of database queries? I would like to avoid doing N+1 queries.
If not, is this possible in another .NET ORM framework?