namespace Application.Api; public record GetCardsQuery() : IRequestWrapper>; public class GetCardsQueryHandler : RequestHandlerBase> { public GetCardsQueryHandler(ICardDependencyAggregate aggregate) : base(aggregate) { } public override async Task>> Handle(GetCardsQuery request, CancellationToken cancellationToken) { var cards = await CardDbContext.CardMains.ToListAsync(cancellationToken: cancellationToken); var dtoList = cards.Select(card => card.CardMainToClientDto()).ToList(); return new ServiceResult>(dtoList); } }