【发布时间】:2016-06-11 09:11:15
【问题描述】:
我有两个表,Doctors 和 DoctorShifts,两个表之间的关系是一个(Doctor)到多个(DoctorShifts)。
在 DoctorShifts 中,我保存了每位正在工作的医生的星期几。
我需要的是显示今天工作的医生列表,我尝试了以下表达式但它不起作用:
IQueryable<Doctor> TodayDoctorsQuery = _context.Doctors.Where(s => s.DoctorShifts.Where(s2 => s2.DayOfTheWeek == _todayNumber) != null);
错误是:
无法比较“System.Collections.Generic.IEnumerable`1[[MedCare_Software.EDM.DoctorShift, MedCare-Software, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]”类型的元素。仅支持原始类型、枚举类型和实体类型。"}
如何获取今天工作的医生名单?
【问题讨论】:
-
这与 WPF 有什么关系?
-
在末尾添加:ToList();