Пример #1
0
        public ActionResult Create(Playlist playlist)
        {
            if (ModelState.IsValid)
            {
                db.Playlists.Add(playlist);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(playlist);
        }
Пример #2
0
 public ActionResult Edit(Playlist playlist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(playlist).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(playlist);
 }