public IActionResult OnGet() { ViewData["AgeRatingId"] = new SelectList(_context.Set <AgeRating>(), "AgeRatingId", "Rating"); ViewData["DirectorId"] = new SelectList(_context.Set <Director>(), "DirectorId", "TheDirectors"); ViewData["GenreId"] = new SelectList(_context.Set <Genre>(), "GenreId", "Genres"); ViewData["YearOfReleaseId"] = new SelectList(_context.Set <YearOfRelease>(), "YearOfReleaseId", "Year"); return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Movies = await _context.Movies .Include(m => m.AgeRating) .Include(m => m.Director) .Include(m => m.Genre) .Include(m => m.YearOfRelease).FirstOrDefaultAsync(m => m.MovieId == id); if (Movies == null) { return(NotFound()); } ViewData["AgeRatingId"] = new SelectList(_context.Set <AgeRating>(), "AgeRatingId", "Rating"); ViewData["DirectorId"] = new SelectList(_context.Set <Director>(), "DirectorId", "TheDirectors"); ViewData["GenreId"] = new SelectList(_context.Set <Genre>(), "GenreId", "Genres"); ViewData["YearOfReleaseId"] = new SelectList(_context.Set <YearOfRelease>(), "YearOfReleaseId", "Year"); return(Page()); }