previously, back in EF Frameowrk days, the following method sufficed when needing the related entities to an entity.
private IQueryable<T> EntitySet(params Expression<Func<T, object>>[] includes)
{
var set = Context.Set<T>().Where(x => !x.IsDeleted);
if (includes != null)
{
foreach (var include in includes)
{
set = set.Include(include);
}
}
return set;
}
I'd call this method with something like EntitySet(x => x.People, x => x.People.Meetings). However, ever since moving to EF core, I can no longer get the related data because I need to explicitly use Include(x.People).ThenInclude(p.Meegings).
Is what I'm trying to do even possible in EF core? Or were there so many changes in gather related data so that the above method is no longer applicable?