public Result <Transaction> Handle(SalvarTransacaoCommand command) { var transacao = _transacaoRepository.Salvar(command.Descricao, command.Valor, command.Data); return(new Result <Transaction> { Dado = transacao }); }
public Transaction SalvarTransacao([FromBody] TransacaoDTO dto) { var command = new SalvarTransacaoCommand { Data = dto.Data, Descricao = dto.Descricao, Valor = dto.Valor }; var handler = new TransacaoCommandHandler(); var result = handler.Handle(command); return(result.Dado); }