[HttpPost] public JsonResult Search(List<Predicate> predicates) { if (predicates == null) { }); } using (var connection = SqlHelper.GetConnection()) { var pga = new PredicateGroup { Operator = GroupOperator.And, Predicates = new List<IPredicate>() }; foreach (var p in predicates) { var predicate = Predicates.Field<Account>(GetExpression(p), (Operator)Enum.Parse(typeof(Operator), p.OperatorItem), p.Value); pga.Predicates.Add(predicate); } var list = connection.GetList<Account>(pga); return Json(list); } } private static Expression<Func<Account, object>> GetExpression(Predicate p) { ParameterExpression parameter = Expression.Parameter(); return Expression.Lambda<Func<Account, object>>(Expression.Convert(Expression.Property(parameter, p.ColumnItem), typeof(object)), parameter); }