public IActionResult List(string uloginName, string urealName, string ugender, string status, PagerInfo pagerInfo) { Expression <Func <SysUserInfo, bool> > whereExpression = u => true; if (!string.IsNullOrEmpty(uloginName)) { whereExpression = whereExpression.And(u => u.ULoginName.Contains(uloginName)); } if (!string.IsNullOrEmpty(urealName)) { whereExpression = whereExpression.And(u => u.URealName.Contains(urealName)); } if (!string.IsNullOrEmpty(ugender)) { int gender = Convert.ToInt32(ugender); whereExpression = whereExpression.And(u => u.UGender.Equals(gender)); } if (!string.IsNullOrEmpty(status)) { int state = Convert.ToInt32(status); whereExpression = whereExpression.And(u => u.Status.Equals(state)); } var list = _sysUserInfoService.GetList(pagerInfo.PageIndex, pagerInfo.PageSize, out var count, whereExpression, false, u => u.CreatedTime); return(Json(BuildSuccessTableResult(count, list))); }