Efcore: Include siblings syntactic sugar

Created on 6 May 2015  路  1Comment  路  Source: dotnet/efcore

Instead of writing this...

``` C#
db.Posts
.Include(p => p.Author)
.Include(p => p.Sponsor);

...it might be interesting to enable writing this instead.

``` C#
db.Posts.Include(p => new { p.Author, p.Sponsor });

It could also extend to ThenInclude.

C# db.Blogs.Include(b => Posts).ThenInclude(p => new { p.Author, p.Sponsor });

Note, it would prevent chaining additional ThenInclude calls, but I think that's an acceptable limitation of the sugar.

type-enhancement

>All comments

Give you can't chain we aren't going to do this.

Was this page helpful?
0 / 5 - 0 ratings