如何在数据库联接中使用IList

时间:2018-06-25 11:00:21

标签: c# list join dbcontext

ListMemSal = (from mem in ocontext.MEMBERs.Where(m => m.STATUS == 1 && m.SALARY_TYPE == 1)
   join dept in ocontext.DEPARTMENTs on mem.DEPT_ID equals dept.DEP_ID
   where dept.DEP_ID == DEP_ID                                                          
   from sal in OListSalary.Where(m => m.MEMBER_ID == mem.ID && m.ISSUED_DATE.Month == _date.Month && m.ISSUED_DATE.Year == _date.Year).DefaultIfEmpty()
   from jobTitle in ocontext.JOB_TITLE.Where(m => m.ID == mem.JOB_ID).DefaultIfEmpty()

我的代码from sal in OlistSalary.....的第4行出现错误

如何在联接中使用ilist?

错误日志:

  

无法创建类型为'NameSpace.SALARY'的常量值。只要   在此上下文中支持基本类型或枚举类型。

0 个答案:

没有答案