コード例 #1
0
        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();
        }
コード例 #2
0
 public IActionResult OnGet()
 {
     ViewData["MID"]     = new SelectList(_context.Set <Manufacturer>(), "MId", "MId");
     ViewData["StoreId"] = new SelectList(_context.Set <Store>(), "StoreId", "StoreId");
     return(Page());
 }