Hi, can anyone tell me how you can make it so that in the non-match between strings it's not case sensitive in a query?
var list = (from p in context.Patient
where p.Name.Contains (query) || p.Cognome.Contains (query)
orderby p.Name, p.Cognome
select p) .ToList ();
In this query the contains is case sensitive and therefore does not return a correct result. how can I do?
query no case sensitive with Contains string
Re: query no case sensitive with Contains string
Try this way:
Code: Select all
p.Name.Contains("some string")
->
p.Name.ToUpper().Contains("some string".ToUpper())
Re: query no case sensitive with Contains string
One more solution is to change the column data type to citext: https://www.postgresql.org/docs/current/citext.html.