using HrynCo.DAL.Abstract; using HrynCo.NotificationService.DAL.Abstract.Providers; using HrynCo.NotificationService.DAL.Abstract.Repositories; using HrynCo.NotificationService.Services.Core; using HrynCo.NotificationService.Services.Logging; using static HrynCo.NotificationService.Services.Core.ServiceResultHelper; namespace HrynCo.NotificationService.Services.EmailChannels.GetByService; internal sealed class GetEmailChannelsHandler : RequestHandler>> { private readonly IEmailChannelRepository _channels; public GetEmailChannelsHandler( IContextualSerilogLogger logger, IUnitOfWork unitOfWork, IEmailChannelRepository channels) : base(logger, unitOfWork) { _channels = channels; } protected override async Task>> DoOnHandle( GetEmailChannelsQuery request, CancellationToken cancellationToken) { var channels = await _channels.GetByServiceAsync(request.ServiceName, cancellationToken); return Success(channels); } }