public IActionResult Put(int id, [FromBody] Curso model) { model.Id = id; return(Json( _cursoServices.Update(model) )); }
public async Task <IHttpActionResult> PutCursos(Int32 id, CursoBE curso) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } curso.id_curso = id; _services.Update(id, curso); return(Ok()); } catch (Exception ex) { var except = (ApiBusinessException)HandlerErrorExceptions.GetInstance().RunCustomExceptions(ex); var resp = BadRequest(Convert.ToString(except.ErrorDescription)); return(resp); } }