Beispiel #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,Stock,Price,CreationDate")] Food food)
 {
     if (ModelState.IsValid)
     {
         db.Entry(food).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(food));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,Genre,ReleaseDate,DateAdded,Stock,MembershipTypeId")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MembershipTypeId = new SelectList(db.MemberShiptype, "Id", "Name", movie.GenreId);
     return(View(movie));
 }