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

            PizzaOrder = await _context.PizzaOrder
                         .Include(p => p.Order)
                         .Include(p => p.Pizza).FirstOrDefaultAsync(m => m.PizzaOrderId == id);

            if (PizzaOrder == null)
            {
                return(NotFound());
            }
            ViewData["OrderNumber"] = new SelectList(_context.Order, "OrderNumber", "OrderNumber");
            ViewData["PizzaCode"]   = new SelectList(_context.Set <Pizza>(), "PizzaCode", "PizzaCode");
            return(Page());
        }
예제 #2
0
 public IActionResult OnGet()
 {
     ViewData["OrderNumber"] = new SelectList(_context.Order, "OrderNumber", "OrderNumber");
     ViewData["PizzaCode"]   = new SelectList(_context.Set <Pizza>(), "PizzaCode", "PizzaCode");
     return(Page());
 }