I can get partial matches on string fields with a query like this:
employees = context.Employees
.Where(ee => ee.LastName.Contains(text))
.ToList();
Is there any way to do the same for integer fields? I tried converting to a string on the fly but no luck:
employees = context.Employees
.Where(ee => ee.EmployeeID.ToString().Contains(text))
.ToList();
Well given that this is hypothetical, if EF doesn’t support it directly, just force it to happen in-process:
Given that it’s already a bad idea, pulling all the employee data isn’t so much worse 😉