// POST api/Titles public HttpResponseMessage PostTitle(Title title) { if (ModelState.IsValid) { db.Titles.Add(title); db.SaveChanges(); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, title); response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = title.TitleId })); return response; } else { return Request.CreateResponse(HttpStatusCode.BadRequest); } }
// PUT api/Titles/5 public HttpResponseMessage PutTitle(Title title) { return Request.CreateResponse(HttpStatusCode.NotImplemented); }