Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "CategoryID,Name")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "PostID,Title,Content,Image,Note,CategoryID")] Post post)
 {
     if (ModelState.IsValid)
     {
         db.Entry(post).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(post));
 }