public async Task <IActionResult> GetRoles([FromBody] BootTabPageListPar bootTabPlist) { if (!string.IsNullOrEmpty(bootTabPlist.Search)) { if (bootTabPlist?.Filters == null) { QueryableFilter[] fiters = { new QueryableFilter() { Condition = Condition.Or, Contract = Contract.Like, Key = "Name", Value = bootTabPlist.Search } }; bootTabPlist.Filters = fiters; } } var results = await roleManager.GetListAsync <EditRoleDto>(bootTabPlist); return(Json(new BootTabPageResult { Page = bootTabPlist.CurrentPage, Total = results.TotalItemCount, Rows = results })); }
public async Task <IActionResult> GetUsers([FromBody] BootTabPageListPar par) { if (par.Search.IsNotNullOrEmpty()) { par.Filters = new QueryableFilter[] { new QueryableFilter { Key = "Name", Contract = Contract.Like, Value = par.Search } }; } var results = await _userManager.GetListAsync <UserDto>(par); return(Json(new BootTabPageResult { Page = par.CurrentPage, Total = results.TotalItemCount, Rows = results })); }