Jeaf Gilbert Jeaf Gilbert - 1 year ago 169
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 Source
fi => fi.DESCRIPTION.ToLower().Contains(description.ToLower())
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download