I have this:
var sortName = Request.Params['sortName']; var query = Request.Params['query']; Func<UsuarioEndereco, bool> whereClause = (uen => uen.GetPropValue<string>(sortName).Contains(query));
The 'uen.GetPropValue<string>(sortName)' will be filled dynamically with the sortName the user typed in the page.
For example, if an user looks for a person named ‘Joe’, the snippet will be:
(uen => uen.namePerson.Contains(Joe))
But, I’m having problems with LINQ Case-sensitive searches. If I type ‘Joe’, I will something. On the other hand, If I type ‘joe’, it bring nothing.
How can I make this ‘Contains(sortName)’ works with Case-Insensitive?? I’ve tried some things with String.Comparer but it reports errors on build solution.
Thanks!!
I believe the following will generate proper SQL: