Beispiel #1
0
 public ActionResult Create(Movie movie, int GenreId)
 {
     _db.Movies.Add(movie);
     if (GenreId != 0)
     {
         _db.GenreMovie.Add(new GenreMovie()
         {
             GenreId = GenreId, MovieId = movie.MovieId
         });
     }
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public ActionResult Create(Genre genre)
 {
     _db.Genres.Add(genre);
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }