Index.cshtml.cs 459 B

1234567891011121314151617
  1. using Microsoft.AspNetCore.Mvc.RazorPages;
  2. using MediatR;
  3. namespace Admin.Pages.Director.User
  4. {
  5. public class IndexModel(IMediator mediator) : PageModel
  6. {
  7. public int Total { get; set; } = 0;
  8. public List<GetUsers.Response> List { get; set; } = [];
  9. public async Task OnGetAsync(CancellationToken ct)
  10. {
  11. List = await mediator.Send(new GetUsers.Query(), ct);
  12. Total = List.Count;
  13. }
  14. }
  15. }