public ActionResult Put(Guid id, Car value) { if (!repo.Update(id, value)) { return new HttpStatusCodeResult(422); // Unprocessable Entity -> Validation Error } return Ok(); }
public ActionResult Post(Car value) { var newEntity = repo.Add(value); // Create entity in DB return Created(String.Format("{0}{1}", Request.GetUri(), newEntity.Id), newEntity); // Return OK Header with Entity Location }