I have nested entites like example from msdn .
var blogs1 = context.Blogs
.Include(b => b.Posts.Select(p => p.Comments))
.ToList();
But in my case, Comment have structure like this:
public class Comment
{
public List<User> ViewedUsers { get; set; };
}
How can i load ViewedUsers in this case, if method .ThenInclude()
is unavalable? I mean new layer of nested entites.
In this case i need to use next statement:
var blogs1 = context.Blogs
.Include(b => b.Posts.Select(p => p.Comments.Select(cm => cm.ViewedUsers)))
.ToList();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.