Adding paging to notifications grid

This commit is contained in:
rockstardev
2020-06-15 00:00:56 -05:00
parent 113869bd08
commit f072ec3a8c
3 changed files with 73 additions and 4 deletions

View File

@@ -40,12 +40,15 @@ namespace BTCPayServer.Controllers
var model = new IndexViewModel()
{
Skip = skip,
Count = count,
Items = _db.Notifications
.OrderByDescending(a => a.Created)
.Skip(skip).Take(count)
.Where(a => a.ApplicationUserId == userId)
.Select(a => a.ViewModel())
.ToList()
.ToList(),
Total = _db.Notifications.Where(a => a.ApplicationUserId == userId).Count()
};
return View(model);