Enable Lambda Expression Use

In a line-based overloaded, Includewe indicate to enable the collection, and then link one level down, simply by specifying the appropriate navigation properties in the correct order:

query.Include("Level1Collection.Level2Reference");

But why when using an overload Includethat uses a lambda expression, we must also use a statement Selectto indicate the above query:

query.Include(e => e.Level1Collection.Select(l1 => l1.Level2Reference)).

Why not work the following:

query.Include.(e => e.Level1Collection.Level2Reference)

Thank you

+5
source share
1 answer

, collection . , intellisense.

Include string, , , , , . , , , ( "Level2Reference" ).

: .:)

+7

All Articles