public GetAllReportForAdminViewModel GetAllReport(int pageid = 1, string filtertitle = "") { IQueryable <Report> reports = _context.Reports; if (!string.IsNullOrEmpty(filtertitle)) { reports = reports.Where(r => r.ReportTitle.Contains(filtertitle)); } int take = 5; int skip = (pageid - 1) * take; GetAllReportForAdminViewModel list = new GetAllReportForAdminViewModel(); list.CurrentPage = pageid; list.PageCount = (reports.Count() / take); list.Reports = reports.OrderByDescending(g => g.GroupID).Skip(skip).Take(take).ToList(); return(list); }
public void OnGet(int pageid = 1, string filtertitle = "") { Reports = _reportService.GetAllReport(pageid, filtertitle); }