// PUT api/values/5 public ValidationResult_OSC Put([FromBody]OnlineShoppingCart.Model.Product product) { var result = new ValidationResult_OSC(); ValidationHelper validationHelper = new ValidationHelper(ref result, ModelState); if (result.Success) { DAL.Product productDAL = new DAL.Product(); result = productDAL.UpdateProduct(product); } return result; }
//public Result<List<OnlineShoppingCart.Model.ProductCategory>> Get(string category) //{ // DAL.ProductCategory productCategoryDAL = new DAL.ProductCategory(); // return productCategoryDAL.GetCategoryList(category); //} // POST api/values public ValidationResult_OSC Post([FromBody]OnlineShoppingCart.Model.ProductCategory productCategory) { var result = new ValidationResult_OSC(); ValidationHelper validationHelper = new ValidationHelper(ref result, ModelState); if (result.Success) { DAL.ProductCategory productDAL = new DAL.ProductCategory(); result = productDAL.AddCategory(productCategory); } return result; }