public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { var model = new ConditionModelCollection(); GetValue(bindingContext, "condition"); return(model); }
public void TestMethod3() { var aa = new ConditionModelCollection(); aa.Add(new ConditionModel() { Field = "UserName", Value = "s", Op = Operation.contain }); aa.Add(new ConditionModel() { Field = "Mobile", Value = new string[] { "13255558796", "12555545856" }, Op = Operation.contain }); var exp = aa.ToExpression <T_User>(); var users = new List <T_User>() { new T_User() { UserName = "******", Mobile = "13255558796" }, new T_User() { UserName = "******", Mobile = "12555545856" } }; var w = exp.Compile(); var us = users.Where(w).ToList(); }
public ActionResult Query(PageingModel pageing, ConditionModelCollection condition) { if (Request.IsAjaxRequest()) { var name = nameof(IEntityService <dynamic> .SelectPage); var result = ExecuteMethod(name, new Type[] { typeof(IExpressionLambdaModel), typeof(int), typeof(int) }, condition as IExpressionLambdaModel, pageing.PageIndex, pageing.PageSize); return(JsonSuccess(result)); } return(View()); }
/// <summary> /// 获取用户列表 /// </summary> /// <returns></returns> public ActionResult GetUserList(PageingModel pageing, ConditionModelCollection conditions) { var datas = userService.SelectPage(conditions, pageing.PageIndex, pageing.PageSize); return(JsonSuccess(datas)); }