public ActionResult Edit(Role role) { if (ModelState.IsValid) { //role.Creation db.Roles.Attach(role); db.ObjectStateManager.ChangeObjectState(role, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(role); }
public ActionResult Create(Role role) { if (ModelState.IsValid) { role.Creation = DateTime.Now; db.Roles.AddObject(role); db.SaveChanges(); return RedirectToAction("Index"); } return View(role); }