using Application.Abstractions.Messaging; using Application.Abstractions.Identity; namespace Application.Features.Director.Roles.Get { public sealed class Handler(IIdentityRoleReader roleReader) : IQueryHandler> { public async Task> Handle(Query request, CancellationToken ct) { var roles = await roleReader.GetRolesAsync(ct); return [..roles.Select(role => new Response { ID = role.ID, Name = role.Name, ClaimsCount = role.Claims.Count })]; } } }