//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)); } }
public async Task <IActionResult> AdicionarCategoria([FromBody] CriarCategoria request) { return(await ExecutarComando(request)); }