2

enter image description hereI'm trying to include in one LINQ query few entities. Entity UserPrograms > Entity Training Program > Entity SetDetails by this query

return await _db.UserPrograms.Include(x => x.TrainingProgram).Where(x=> x.IsPredefined.Value).AsNoTracking().ToArrayAsync();

SetDetails has foreign key in TrainingPrograms, TrainingPrograms has foreign key in UserPrograms, so it look like I cannot include all of these entities to the same query. You may say that I might first get SetDetails and then join to UserPrograms+TrainingPrograms results, yes, but is it possible to make in one query?

andrey.shedko
  • 3,128
  • 10
  • 61
  • 121

0 Answers0