Index.cshtml.cs 441 B

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