Exemple #1
0
 public IHttpActionResult PutProducts(ProductData product)
 {
     if (ModelState.IsValid)
     {
         Product pro = service.FindById(4);
         pro.Name = product.Name;
         service.Edit(pro);
     }
     return(Ok(false));
 }
Exemple #2
0
        public IActionResult Edit(ProductFormVM model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            string thumb = UploadFile(model.Product.file);

            model.Product.Thumb = string.IsNullOrEmpty(thumb) ? model.Product.Thumb : thumb;
            productOperations.Edit(model.Product);
            return(View(model));
        }
Exemple #3
0
 public IActionResult Edit([FromQuery] ProductChangeModel model)
 {
     if (ModelState.IsValid)
     {
         _productOperations.Edit(model);
     }
     else
     {
         return(BadRequest());
     }
     return(Ok());
 }
        public IActionResult Edit([FromBody] ProductViewModel model)
        {
            var res = product.Edit(model);

            return(Ok(res));
        }