if (!string.IsNullOrEmpty(Queries["SurnameInitial"]))
{
var initials = Queries["SurnameInitial"].Split(',').ToList();
filter.And(s => initials.Contains(s.Surname.ToArray()[0].ToString()));
}
It throws exception
LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.
How can i match char vs string?
s.Surname.ToArray()[0]is a char. The Linq namespace contains an extension on IEnumerablesContains(char); is that usable? Alternatively, could you useIndexOf(char)and test for!= -1?