When I use ToLowerInvariant
or ToUpperInvariant
they don't work in lambda expressions.
I get an exception:
LINQ to Entities does not recognize the method 'System.String ToUpperInvariant()' method, and this method cannot be translated into a store expression.
How can I use these methods or how can I convert UTF8 characters inside lambda expressions to lower or upper case?
var words = context.Words;
if (words.Any(wr => wr.Orthography.ToUpperInvariant() == textRange.Text.ToUpperInvariant()))