public async Task <ICommandResponse> Handle(AtualizarSaldoExtratoCommand command, CancellationToken cancellationToken)
 {
     return(await CommandHandlerHelper.ExecuteToResponse(() => {
         var extrato = extratoService.RetornarExtrato(command.ExtratoId).Result;
         var evento = new ExtratoSaldoAtualizadoIntegrationEvent(command.ExtratoId, extrato.Saldo);
         eventBus.PublishEvent(evento);
     }));
 }
コード例 #2
0
 public async Task <ICommandResponse> Handle(CriarParticipanteCommand command, CancellationToken cancellationToken)
 {
     return(await CommandHandlerHelper.ExecuteToResponse(
                () => participanteService.AdicionarParticipante(command.Id, command.Nome, command.Email)));
 }
コード例 #3
0
 public Task <ICommandResponse> Handle(EfetuarQuebraPontosExtratoCommand command, CancellationToken cancellationToken)
 {
     return(CommandHandlerHelper.ExecuteToResponse(() => extratoService.EfetuarQuebraPontos(command.ExtratoId, command.Pontos)));
 }
コード例 #4
0
 public Task <ICommandResponse> Handle(AlterarNomeParticipanteCommand command, CancellationToken cancellationToken)
 {
     return(CommandHandlerHelper.ExecuteToResponse(() => participanteService.AlterarNome(command.ParticipanteId, command.Nome)));
 }
コード例 #5
0
 public Task <ICommandResponse> Handle(CriarExtratoCommand command, CancellationToken cancellationToken)
 {
     return(CommandHandlerHelper.ExecuteToResponse(() => extratoService.CriarExtrato(command.ExtratoId, command.ParticipanteId)));
 }