Beispiel #1
0
 public ActionResult Edit(ProductFeature productFeature)
 {
     if (!ModelState.IsValid)
     {
         return(View(productFeature));
     }
     _productFeatureRepository.Update(productFeature);
     _productFeatureRepository.Save();
     return(RedirectToAction("Index", new { id = productFeature.ProductId }));
 }
        public ActionResult Edit(int?id, ProductFeature productFeature)
        {
            if (!ModelState.IsValid)
            {
                return(View(productFeature));
            }
            var feature = _productFeatureRepository.GetById(id.Value);

            _productFeatureRepository.Update(productFeature);
            _productFeatureRepository.Save();
            return(RedirectToAction("Index", new { id = feature.ProductId }));
        }