Exemple #1
0
        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());
        }
Exemple #2
0
 public IActionResult OnGet()
 {
     ViewData["GenreId"] = new SelectList(_context.Set <Genre>(), "GenreId", "GenreId");
     return(Page());
 }