Example #1
0
        //teste
        private async Task <IActionResult> ExecutarComando(CriarCategoria obj)
        {
            try
            {
                var response = await _mediator.Send(obj, CancellationToken.None);

                return(await ResponseAsync(response));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Example #2
0
 public async Task <IActionResult> AdicionarCategoria([FromBody] CriarCategoria request)
 {
     return(await ExecutarComando(request));
 }