public Task <AllErrorReportOutput> GetErrorReportsAsync(AllErrorReportInput input) { var reports = _repository .GetAll() .Where(x => x.IsActive) .OrderByDescending(x => x.CreationTime); return(Task.Run(() => new AllErrorReportOutput { Reports = reports .ToPagedList(input.PageIndex, input.PageSize) .MapTo <IPagedList <ErrorReportDto> >() })); }
public async Task <ActionResult> ErrorReports(int?page) { var input = new AllErrorReportInput { PageIndex = page - 1 ?? 0, PageSize = 25 }; var output = await _feedbackService.GetErrorReportsAsync(input); var model = output.MapTo <PreViewErrorReportViewModel>(); model.ActiveMenu = ActiveMenuItemName; if (Request.IsAjaxRequest()) { return(PartialView("_ErrorReports", model)); } return(View("ErrorReports", model)); }