Example #1
0
 public async Task <IActionResult> Index(int?pageNumber)
 {
     return(View(await PaginatedList <Subject> .GetPaginatedListAsync(
                     _dbContext.Subjects
                     .Include(u => u.User)
                     .Select(s => new Subject
     {
         SubjectId = s.SubjectId,
         Name = s.Name,
         User = new User
         {
             LastName = s.User.LastName,
             Email = s.User.Email
         }
     }).AsNoTracking(),
                     pageNumber ?? Constants.Pagging.DEFAULT_PAGE_INDEX,
                     Constants.Pagging.PAGE_SIZE)));
 }
Example #2
0
 public async Task <IActionResult> Index(int?pageNumber)
 {
     return(View(await PaginatedList <Faq> .GetPaginatedListAsync(
                     _dbContext.Faqs
                     .Include(u => u.User)
                     .Select(f => new Faq
     {
         FaqId = f.FaqId,
         Question = f.Question,
         Answer = f.Answer,
         User = new User
         {
             LastName = f.User.LastName,
             Email = f.User.Email
         }
     }).AsNoTracking(),
                     pageNumber ?? Constants.Pagging.DEFAULT_PAGE_INDEX,
                     Constants.Pagging.PAGE_SIZE)));
 }