public ActionResult Other2() { var movie = new Movie { Title = "CustomTitle" }; var db = new GenericDBContext(); var cats = db.Categories.ToArray(); return this.View(movie); }
public ActionResult Create(Movie movie) { if (this.ModelState.IsValid) { this.db.Movies.Add(movie); this.db.SaveChanges(); return this.RedirectToAction("Index"); } return this.View(movie); }
public ActionResult Edit(Movie movie) { if (this.ModelState.IsValid) { this.db.Entry(movie).State = EntityState.Modified; this.db.SaveChanges(); return this.RedirectToAction("Index"); } return this.View(movie); }