// POST api/categories public HttpResponseMessage Post(Category category) { var response = Request.CreateResponse(HttpStatusCode.Created, category); response.Headers.Location = new Uri(Request.RequestUri, string.Format("categories/{0}", category.Id)); _categoriesRepository.Add(category); return response; }
// PUT api/categories/5 public void Put(int id, Category category) { _categoriesRepository.Update(category); }