Exemplo n.º 1
0
 public ActionResult Edit(Role role)
 {
     if (ModelState.IsValid)
     {
         context.Entry(role).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(role);
 }
Exemplo n.º 2
0
        public ActionResult Create(Role role)
        {
            if (ModelState.IsValid)
            {
                context.Roles.Add(role);
                context.SaveChanges();
                return RedirectToAction("Index");  
            }

            return View(role);
        }
Exemplo n.º 3
0
 public void InsertOrUpdate(Role role)
 {
     // Roles are different as there is only one column (primary key). Therefore there is really only insert
     // without messing up all of the relationships.
     context.Roles.Add(role);
 }