public async Task <Unit> Handle(AdicionarSeguradoCommand request, CancellationToken cancellationToken) { var nomeCompleto = NomeCompleto.Create(request.Nome, request.Sobrenome); var dataNascimento = DataNascimento.Create(request.DataNascimento); var validationResult = Result.Combine(nomeCompleto, dataNascimento); if (validationResult.IsFailure) { await _mediatorHandler.RaiseDomainEvents(this, validationResult.Errors); return(Unit.Value); } var segurado = new Segurado(nomeCompleto.Value, dataNascimento.Value); await _seguradoRepository.Adicionar(segurado); await _seguradoRepository.Salvar(); return(Unit.Value); }