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