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

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