1

I've a in memory collection of employees, Its a list of employees, i.e.var employeeMapingList = employeeMapping.AsEnumerable();

I'm trying to write this query ->

employees = (from emp in employees
         join x in employeeMapingList on emp.Emp_ID equals x.Map_To_Emp_Id
         join y in employeeMapingList  on emp.Dept_ID equals y.Dept_ID
         where ((x.Map_To_Emp_Id == emp.Emp_ID && x.DataSource == emp.Data_Source)||
              (y.Emp_Id == emp.Emp_ID && y.DataSource == emp.Data_Source) 
              )                 
           select emp);

I'm getting following error => Unable to create a constant value of type 'XXX'. Only primitive types or enumeration types are supported in this context.

Appreciate your help in advance !

  • Does this answer your question? [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) – devNull Apr 24 '20 at 03:59

0 Answers0