public ActionResult Edit([Bind(Include = "CharacterId,Name,Description,NovelId")] Character character)
 {
     if (ModelState.IsValid)
     {
         var novel = db.Novels.Find(character.NovelId);
         character.Novel           = novel;
         db.Entry(character).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     return(View(character));
 }
Exemplo n.º 2
0
 public ActionResult Edit(Setting setting)
 {
     if (ModelState.IsValid)
     {
         var novel = db.Novels.Find(setting.NovelId);
         setting.Novel           = novel;
         db.Entry(setting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     return(PartialView(setting));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "NovelId,Title,Synopsis,DateAccessed")] Novel novel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(novel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     return(PartialView(novel));
 }