Esempio n. 1
0
        public ActionResult Put(Guid id, Car value)
        {
            if (!repo.Update(id, value))
            {
                return new HttpStatusCodeResult(422); // Unprocessable Entity -> Validation Error
            }

            return Ok();
        }
Esempio n. 2
0
 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
 }