I want to create below SQL query in dapper extentions.
SELECT DISTINCT Description FROM tblPeople WHERE ID = 2 AND
(AddressTown IS NOT NULL AND AddressTown<>'') ORDER BY Description ;
I have tried so far:
PredicateGroup pgMain = new PredicateGroup
{ Operator = GroupOperator.And, Predicates = new List<IPredicate>() };
pgMain.Predicates.Add(Predicates.Field<tblPeople >(f => f.ID, Operator.Eq, 2));
var peopleList = connection.GetList<tblPeople>(pgMain);