I have the employee numbers in the database starting stored this way
EmployeeNumber
E123456
E999999
E666666
E111111
I want to write a LINQ statement to match the database EmployeeNumber with employeeId that is passed from web. I wrote the LINQ like this:
_akContext.EmployeeInfos.Where(e => e.EmployeeNumber.TrimStart('E') == employeeId.TrimStart('E')).OrderBy(e => e.EmployeeInfoId).Select(e => e.EmployeeInfoId).ToList();
With the above LINQ statement, I keep getting an error saying:
The LINQ expression 'DbSet<EmployeeInfo>()
.Where(e => e.EmployeeNumber.TrimStart(E) == __TrimStart_0)' could not be translated