My table relations:
Categories
has many Posts
has many PostImages
I want to retrieve Categories>LastPost>FirstPostImage. And I tried something like following:
var categories = entity.Categories
.Where(x => x.PositionId == 2)
.Include(x => x.Posts.Last())
.Include(x => x.Posts.Last().PostImages.First())
.Take(5)
.ToList();
Question: Is there an elegant way to achive this? Is there commonly usage of eager loading for nested relational tables?