I'm trying to do a case insenstive match against a MySQL table while using Dapper Extensions, but I'm getting a null exception on the field name when trying to make it UpperCase within the linq expression:
Here's the code:
var predicateGroup = new PredicateGroup { Operator = GroupOperator.Or, Predicates = new List<IPredicate>() };
var term = "term";
if (term.IsNotNullOrEmpty())
{
predicateGroup.Predicates.Add(Predicates.Field<Company>(p => p.company_code, Operator.Like, string.Format("%{0}%", term)));
predicateGroup.Predicates.Add(Predicates.Field<Company>(p => p.company_name.ToUpper(), Operator.Like, string.Format("%{0}%", term)));
}
return Count<Company>(predicateGroup, TdsAuthConnectionString);
Does anybody know how I can use DapperExtensions predicates to do a case insensitive match?
Thank you for any help, codenewbie