public IActionResult RegistrarVenda([FromBody] RegistrarVendaCommand command) { _mediator.Send(command); return(Ok()); }
public IActionResult Registrar([FromServices] VendaHandler handler, [FromBody] RegistrarVendaCommand command) { var result = handler.Handle(command); return(result.Success ? (IActionResult)Created("", result) : UnprocessableEntity(result)); }