Example #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));
        }
 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);
 }