Select multiple nested levels of child tables in Entity Framework Core

You can use the keyword ThenInclude instead

e.g.

var company = context.Companies
             .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Car)
             .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Country)
             .FirstOrDefault(co => co.companyID == companyID);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)