public async Task<IActionResult> OnGetAsync(int? id) { if (id == null) { return NotFound(); } Candy = await _context.Candy .Include(c => c.Manufactures) .Include(c => c.Stores).FirstOrDefaultAsync(m => m.CandyId == id); if (Candy == null) { return NotFound(); } ViewData["MID"] = new SelectList(_context.Set<Manufacturer>(), "MId", "MId"); ViewData["StoreId"] = new SelectList(_context.Set<Store>(), "StoreId", "StoreId"); return Page(); }
public IActionResult OnGet() { ViewData["MID"] = new SelectList(_context.Set <Manufacturer>(), "MId", "MId"); ViewData["StoreId"] = new SelectList(_context.Set <Store>(), "StoreId", "StoreId"); return(Page()); }