The Include() method works quite well for Lists on objects. But what if I need to go two levels deep? For example, the method below will return ApplicationServers with the i
For EF 6
using System.Data.Entity; query.Include(x => x.Collection.Select(y => y.Property))
Make sure to add using System.Data.Entity; to get the version of Include that takes in a lambda.
using System.Data.Entity;
Include
For EF Core
Use the new method ThenInclude
query.Include(x => x.Collection) .ThenInclude(x => x.Property);