public ActionResult Create(MovieSet movie)
 {
     if (ModelState.IsValid)
     {
         using (var ctx = new MoviesContext())
         {
             ctx.AddToMovieSets(movie);
             ctx.SaveChanges();
             return RedirectToAction("Index");
         }
     }
     return View(movie);
 }
        public ActionResult Delete(int id)
        {
            try
            {
                using(var ctx = new MoviesContext())
                {
                    var movie = ctx.MovieSets.Where(m => m.ID == id).First();
                    ctx.DeleteObject(movie);
                    ctx.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        public ActionResult Edit(int id, FormCollection collection)
        {
            var ctx = new MoviesContext();
            var movie = ctx.MovieSets.Where(m => m.ID == id).First();

            UpdateModel(movie, new string[] { "Title", "ReleaseDate.Year", "ImageUrl" }, collection.ToValueProvider());

            if (ModelState.IsValid)
            {
                ctx.SaveChanges();
                return RedirectToAction("Index");
            }

            return View();
        }