public CommandResult Create( [FromBody] CreatePagamentoCommand command, [FromServices] PagamentoHandler handler ) { return((CommandResult)handler.Handle(command)); }
public async Task <ActionResult <CreatePagamentoCommand> > Create(CreatePagamentoCommand command) { if (!ModelState.IsValid) { return(CustomResponse(ModelState)); } await _pagamentoService.Create(_mapper.Map <Pagamento>(command)); return(CustomResponse(command)); }