Beispiel #1
0
        public async Task <ActionResult <Produto> > PostProduto([FromBody] ProdutoCreateCommand command)
        {
            try
            {
                var response = await _mediator.Send(command);

                return(Ok(response));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Beispiel #2
0
        public async Task <IActionResult> Put(ProdutoCreateCommand command)
        {
            var response = await mediator.Send(command);

            return(Ok(response));
        }