예제 #1
0
        public ActionResult Create( Setting setting )
        {
            if ( ModelState.IsValid )
            {
                db.Settings.Add( setting );
                db.SaveChanges();
                return RedirectToAction( "Index" );
            }

            return View( setting );
        }
예제 #2
0
 public ActionResult Edit( Setting setting )
 {
     if ( ModelState.IsValid )
     {
         db.Entry( setting ).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction( "Index" );
     }
     return View( setting );
 }