public ActionResult Display() { CustomerMovieViewModel viewModel = new CustomerMovieViewModel(); MovieB mv = new MovieB { Name = "kappan" }; List <customer> customers = new List <customer> { new customer { CName = "Preethi" }, new customer { CName = "Sajan" }, new customer { CName = "Prajwal" }, new customer { CName = "Manu" }, }; viewModel.Movie = mv; viewModel.Customers = customers; return(View(viewModel)); }
public ActionResult Create(MovieB moviebFromView) { if (!ModelState.IsValid) { ViewBag.GenreId = ListGenre(); return(View(moviebFromView)); } dbContext.movies.Add(moviebFromView); dbContext.SaveChanges(); return(RedirectToAction("Index", "Movies")); }