I want a solution to this problem that does not involve ToUpper or ToLower, as I use in the code below;
var upper = term.ToUpper();
using (var db = this.DataContext)
{
return db.Counties.Where(x => x.CountyName.ToUpper().Contains(upper)).ToList();
}
I am using entitly framework so the C# solution of using StringComparison.CurrentCultureIgnoreCase
does not work. It does work for Equals
, EndsWith
and StartsWith
, but not Contains
.