i am trying to query my resultset like this in linq to entities;
var categoriesList = _catRepo.GetAllCategories();
filteredCategories = categoriesList.Where(c=> c.CategoryName.Contains("for"));
However, i don't get any result becuase the CategoryName
is For(Upper Case)
in the database. I have also checked the sql server collation and it is set to _CI_AS. I have no idea how to use contains to filter case insensitive string?
I want basically if someone type like;
filteredCategories = categoriesList.Where(c=> c.CategoryName.Contains("for"));
OR
filteredCategories = categoriesList.Where(c=> c.CategoryName.Contains("For"));
The result should be the same