public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Novel = await _context.Novel .Include(n => n.Genres).FirstOrDefaultAsync(m => m.NovelId == id); if (Novel == null) { return(NotFound()); } ViewData["GenreId"] = new SelectList(_context.Set <Genre>(), "GenreId", "GenreId"); return(Page()); }
public IActionResult OnGet() { ViewData["GenreId"] = new SelectList(_context.Set <Genre>(), "GenreId", "GenreId"); return(Page()); }