public async Task <IActionResult> FindPagination(Pagination pagination) { ResponseHelper objHelper = new ResponseHelper(); try { ReturnBy <Module_PermissionView> vList = new ReturnBy <Module_PermissionView>(); vList.list = await Module_PermissionRepo.FindPaginated(pagination.PageIndex, pagination.PageSize, pagination.CommonSearch); if (vList.list.Count() == 0) { objHelper.Status = StatusCodes.Status200OK; objHelper.Message = "Get Empty Data"; } else { vList.RecordCount = Module_PermissionRepo.RecordCount(pagination.CommonSearch); objHelper.Status = StatusCodes.Status200OK; objHelper.Message = "Get Successfully"; objHelper.Data = vList; } return(Ok(objHelper)); } catch (Exception ex) { objHelper.Status = StatusCodes.Status500InternalServerError; objHelper.Message = ex.Message; return(StatusCode(StatusCodes.Status500InternalServerError, objHelper)); } }
public async Task <IActionResult> FindPagination(Pagination pagination) { ResponseHelper objHelper = new ResponseHelper(); try { pagination.RecordCount = Module_PermissionRepo.RecordCount(pagination.CommonSearch); var vList = await Module_PermissionRepo.FindPaginated(pagination.PageIndex, pagination.PageSize, pagination.CommonSearch); if (vList == null) { objHelper.Status = StatusCodes.Status200OK; objHelper.Message = "Get Empty Data"; } else { objHelper.Status = StatusCodes.Status200OK; objHelper.Message = "Get Successfully"; objHelper.Data = vList; } return(Ok(objHelper)); } catch { objHelper.Status = StatusCodes.Status500InternalServerError; objHelper.Message = "Get Unsuccessful"; return(StatusCode(StatusCodes.Status500InternalServerError, objHelper)); } }