示例#1
0
        public HttpResponseMessage Post([FromBody] Product product)
        {
            var prod = new NHateoas.Sample.Models.EntityFramework.DbProduct(product);

            _dbContext.Products.Add(prod);
            _dbContext.SaveChanges();
            return(Request.CreateResponse <Product>(HttpStatusCode.Created, prod));
        }
示例#2
0
 public HttpResponseMessage Post([FromBody]Product product)
 {
     var prod = new NHateoas.Sample.Models.EntityFramework.DbProduct(product);
     _dbContext.Products.Add(prod);
     _dbContext.SaveChanges();
     return Request.CreateResponse<Product>(HttpStatusCode.Created, prod);
 }