I\'m working a report for an asp.net page and I\'m trying to assign the results of this linq statement to an existing dataset but I\'m receiving the \"Only primitive types or en
You can't mix entity types from different contexts in single LINQ query. Either put them into single context, or try to execute this:
var employeeIds = (from o in contextHistory.emp_history select o.employeeID).ToList();
and then pass this list into the second query:
var rslt = (from c in contextTable.TableofOrganizationRpts
where !employeeIds.Contains((int)c.employeeid_fk)
select c).ToList();
This should generate IN
condition in resulting SQL query. Note, that this might work slow.