コード例 #1
0
 // 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;
 }
コード例 #2
0
 // PUT api/categories/5
 public void Put(int id, Category category)
 {
     _categoriesRepository.Update(category);
 }