I have to make search through field EmployeeId. I also have parameter empId which can be something like this: '123' In my database there's next values:
'0123' - what I need
'10123'
'1234'
and so on. My target - take a record which ends on empId and has no or one and more leading 0. I tried to write something like this:
var result = from member in MembersSet
where SqlMethods.Like(member.EmployeeId, "%" + empId) &&
!(SqlMethods.Like(member.EmployeeId, "%[^0]%" + empId))
select member.Id;
But I get an error
LINQ to Entities does not recognize the method 'Boolean Like(System.String, System.String)' method, and this method cannot be translated into a store expression.
May be there is a workaround?