0
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()

I am getting an error on line 4 in my code from sal in OlistSalary.....

How to use ilist in joins?

Error Log :

Unable to create a constant value of type 'NameSpace.SALARY'. Only primitive types or enumeration types are supported in this context.

Gilles-Antoine Nys
  • 1,481
  • 16
  • 21
  • `DefaultIfEmpty` tries to create a default salary instance in case none is available, do you really need it? – vc 74 Jun 25 '18 at 11:05
  • Possible duplicate of [Unable to create a constant value of type Only primitive types or enumeration types are supported in this context](https://stackoverflow.com/questions/18929483/unable-to-create-a-constant-value-of-type-only-primitive-types-or-enumeration-ty) – Alex Riabov Jun 25 '18 at 11:10
  • OlistSalary is an ilist created on that action, i just want my Join to query from that ilist. which in not working now – Abdullah Tahir Jun 25 '18 at 11:38

0 Answers0