Ejemplo n.º 1
0
 // PUT: api/Order/5
 public void Put(int id, Order order)
 {
     order.Id = id;
     if (!orderRepository.Edit(order))
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Ejemplo n.º 2
0
 // POST: api/Order
 public HttpResponseMessage Post(Order order)
 {
     order = orderRepository.Add((order));
     var response = Request.CreateResponse(HttpStatusCode.Created, order);
     string uri = Url.Link("DefaultApi", new { id = order.Id });
     response.Headers.Location = new Uri(uri);
     return response;
 }