Esempio n. 1
0
        public ActionResult Create(Playlist playlist)
        {
            if (ModelState.IsValid)
            {
                db.Playlists.Add(playlist);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(playlist);
        }
Esempio n. 2
0
 public ActionResult Edit(Playlist playlist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(playlist).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(playlist);
 }