Exemplo n.º 1
0
        public async Task Handle(RegistrarNovaSimulacaoCommand command)
        {
            try
            {
                var simulacao = _mapper.Map <Simulacao>(command);
                await _simulacaoRepositorio.SaveAsync(simulacao);

                await _unitOfWork.CommitAsync();

                await _bus.Publish(new SimularParcelamentoEvent(simulacao));
            }
            catch (AggregateException ex)
            {
                _notification.AddNotificacao(ex.Message);
                throw;
            }
        }