How to make the LINQ register case-sensitive and NOT case-sensitive, depending on the situation?
I am using SQL Server 2008 and Entity Framework 4.0.
I modified COLLATION to make SQL Server case sensitive. so for such scenarios:
query = query.Where(x => x.Username == username);
It works great. However, I need to be able to pull data from db ignoring the case when searching by topic (or name or the like) as follows:
query = query.Where(x => (x.Name.Contains(Name)));
which does not work when the record is "TestString" and I am looking for "test" or "test" or the like. How can I make it so that when it finds text or part of a line in text? thank
source
share