예제 #1
0
 public CommandResult Create(
     [FromBody] CreatePagamentoCommand command,
     [FromServices] PagamentoHandler handler
     )
 {
     return((CommandResult)handler.Handle(command));
 }
예제 #2
0
        public async Task <ActionResult <CreatePagamentoCommand> > Create(CreatePagamentoCommand command)
        {
            if (!ModelState.IsValid)
            {
                return(CustomResponse(ModelState));
            }

            await _pagamentoService.Create(_mapper.Map <Pagamento>(command));

            return(CustomResponse(command));
        }