using CMSMicroservice.Protobuf.Protos.Configuration; namespace BackOffice.BFF.Application.ConfigurationCQ.Commands.DeactivateConfiguration; public class DeactivateConfigurationCommandHandler : IRequestHandler { private readonly IApplicationContractContext _context; public DeactivateConfigurationCommandHandler(IApplicationContractContext context) { _context = context; } public async Task Handle(DeactivateConfigurationCommand request, CancellationToken cancellationToken) { var grpcRequest = new DeactivateConfigurationRequest { Key = request.Key }; if (!string.IsNullOrWhiteSpace(request.Reason)) { grpcRequest.Reason = request.Reason; } await _context.Configurations.DeactivateConfigurationAsync(grpcRequest, cancellationToken: cancellationToken); return Unit.Value; } }