public async Task <IActionResult> Create([Bind("Id,MovieName,Plot,ReleaseYear,IsBlockBuster,CreatedDt")] Movie movie) { if (ModelState.IsValid) { _context.Add(movie); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(movie)); }
public async Task <IActionResult> Create([Bind("Id,Name,Gender,DOB,Bio,IsSuperstar,MovieFk")] Actor actor) { if (ModelState.IsValid) { _context.Add(actor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MovieFk"] = new SelectList(_context.Set <Movie>(), "Id", "MovieName", actor.MovieFk); return(View(actor)); }
public async Task <IActionResult> Create([Bind("Id,Name,Sex,DOB,Bio,MovieFk")] Producer producer) { if (ModelState.IsValid) { _context.Add(producer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MovieFk"] = new SelectList(_context.Movie, "Id", "MovieName", producer.MovieFk); return(View(producer)); }