Пример #1
0
        public Product EditProduct(Product product)
        {
            db.Products.Attach(product);
            var entry = db.Entry(product);

            entry.Property(x => x.AverageRating).IsModified = true;
            db.SaveChanges();
            return(product);
        }
Пример #2
0
 public IActionResult Edit(Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
Пример #3
0
        public IActionResult Edit(Experience experience)
        {
            //var thisPersonId = Int32.Parse(Request.Form["People"]);
            //var thisPerson = db.People.FirstOrDefault(People => People.PersonId == thisPersonId);
            //thisPerson.ExperienceId = experience.ExperienceId;
            //var thisExperiencePeople = new ExperiencePeople { };
            //thisExperiencePeople.ExperienceId = experience.ExperienceId;
            //thisExperiencePeople.PersonId = thisPerson.PersonId;
            //db.ExperiencePeople.Add(thisExperiencePeople);

            db.Entry(experience).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #4
0
 public IActionResult Edit(Review review)
 {
     db.Entry(review).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Пример #5
0
 public Product Edit(Product product)
 {
     db.Entry(product).State = EntityState.Modified;
     db.SaveChanges();
     return(product);
 }
Пример #6
0
 public IActionResult Edit(Gummi gummi)
 {
     db.Entry(gummi).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Пример #7
0
 public Review Edit(Review product)
 {
     db.Entry(product).State = EntityState.Modified;
     db.SaveChanges();
     return(product);
 }
 public IActionResult Edit(Category category)
 {
     db.Entry(category).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Пример #9
0
 public IActionResult Edit(Location location)
 {
     db.Entry(location).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }