I have this search method:
public List<Employeees> AutoSuggestEmployeee(string keyword,
long employeeeTypeId, int count)
{
return context.Employeees.Where(
x => x.EmployeeeName.Contains(keyword)
&& x.EmployeeeTypeId == employeeeTypeId)
.Take(count).ToList();
}
I have another collection of Employeees, say "BadEmployeees", what I want is using the same previous method to return all Employeees except "BadEmployeees".
I tried to write it like this:
return context.Employeees.Where(
x => x.EmployeeeName.Contains(keyword)
&& x.EmployeeeTypeId == employeeeTypeId)
.Except(BadEmployeees).Take(count).ToList();
But it is giving an exception that Except
can just work with data types such as Int, Guid,...