Index.cshtml.cs 497 B

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