// PUT api/Locations/{id} public IHttpActionResult Put(int id, [FromBody] Location value) { try { db.Edit(id, value); } catch (Exception ex) { ModelState.AddModelError(nameof(Location), ex.Message); return(BadRequest(ModelState)); } return(Ok()); }