I\'m trying to build a search page using LINQ to Entities, but the following code is giving me a runtime error about l.t.e. not recognising \'Boolean StartsWith(). The code
I would guess that EF doesn't support the overload of StartsWith that takes a StringComparison parameter.
It should support StartsWith, EndsWith and Contains, so maybe you can try:
dp.LastName.StartsWith(searchTerm)
or:
dp.LastName.ToLower().StartsWith(searchTerm)
and then make sure that searchTerm
is also lowercase.