Jeaf Gilbert Jeaf Gilbert - 1 month ago 24
C# Question

LINQ Contains Case Insensitive

This code is case sensitive, how to make it case insensitive?

public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}

Answer
fi => fi.DESCRIPTION.ToLower().Contains(description.ToLower())