示例#1
0
        public List <Transaction> ObterTransacoes()
        {
            var command = new ObterTransacoesCommand
            {
                Data = DateTime.Now
            };

            var handler = new TransacaoCommandHandler();
            var result  = handler.Handle(command);

            return(result.Dado);
        }
示例#2
0
        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);
        }