5 | @if (Model.Users.Any())
6 | {
7 |
8 | @foreach (var user in Model.Users)
9 | {
10 |
11 | @user.Name (@(user.NullableDate?.ToLongDateString() ?? "-"))
12 |
13 | }
14 |
15 |
16 |
17 | (@Model.Count items) (@Model.Elapsed | total with prev/next: @Model.ElapsedTotal)
18 |
19 |
20 |
26 | }
27 | else
28 | {
29 |
Nothing
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/samples/Basic/Pages/Computed.cshtml.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using Basic.Models;
3 | using Microsoft.AspNetCore.Mvc.RazorPages;
4 | using Microsoft.EntityFrameworkCore;
5 | using MR.EntityFrameworkCore.KeysetPagination;
6 |
7 | namespace Basic.Pages
8 | {
9 | public class ComputedModel : PageModel
10 | {
11 | private readonly AppDbContext _dbContext;
12 |
13 | public ComputedModel(
14 | AppDbContext dbContext)
15 | {
16 | _dbContext = dbContext;
17 | }
18 |
19 | public int Count { get; set; }
20 |
21 | public List