public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Food = await _context.Food
                   .Include(f => f.Drinks).FirstOrDefaultAsync(m => m.FID == id);

            if (Food == null)
            {
                return(NotFound());
            }
            ViewData["DID"] = new SelectList(_context.Set <Drink>(), "DID", "DID");
            return(Page());
        }
Example #2
0
 public IActionResult OnGet()
 {
     ViewData["DID"] = new SelectList(_context.Set <Drink>(), "DID", "DID");
     return(Page());
 }