示例#1
0
        public HttpResponseMessage Put(Product product)
        {
            Uow.Products.Update(product);
            Uow.Commit();

            return new HttpResponseMessage(HttpStatusCode.NoContent);
        }
示例#2
0
        public HttpResponseMessage Post(Product product)
        {
            Uow.Products.Add(product);
            Uow.Commit();

            var response = Request.CreateResponse(HttpStatusCode.Created, product);

            response.Headers.Location =
                new Uri(Url.Link("DefaultApi", product.Id));

            return response;
        }