using AutoMapper; using Imprink.Application.Dtos; using MediatR; namespace Imprink.Application.Commands.Users; public record GetAllRolesCommand : IRequest>; public class GetAllRolesHandler(IUnitOfWork uw, IMapper mapper): IRequestHandler> { public async Task> Handle(GetAllRolesCommand request, CancellationToken cancellationToken) { var roles = await uw.RoleRepository.GetAllRolesAsync(cancellationToken); return mapper.Map>(roles); } }