Department {int Id,string Title,Staffs}
Staff {int Id,string Name,int DeptId}
var DeptStaff =
from dept in _context.Departments
select new
{
Department= dept,
StaffCount =
(from staff in _context.Staffs
where staff.DeptId == dept.Id
select staff).Count()
}
Staffs是Department类中的导航属性 在内部查询中给出错误