public async Task <IActionResult> Editar(Categoria categoria) { try { return(Ok(await _service.Editar(categoria))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult Edit(int id, UpdateCategoriaModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } else { return(Ok(service.Editar(id, model))); } }