Esempio n. 1
0
 public ActionResult Edit(Category category)
 {
     _db.Categories.Attach(category);
     _db.Entry(category).State = EntityState.Modified;
     _db.SaveChanges();
     return RedirectToAction("Index");
 }
Esempio n. 2
0
 public ActionResult Create(Category category)
 {
     _db.Categories.Add(category);
     _db.SaveChanges();
     return RedirectToAction("Index");
 }