public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Order_Inventory = await _context.Order_Inventory.FindAsync(id); if (Order_Inventory != null) { _context.Order_Inventory.Remove(Order_Inventory); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Order_Inventory = await _context.Order_Inventory .Include(o => o.Inventory) .Include(o => o.Order).FirstOrDefaultAsync(m => m.id == id); if (Order_Inventory == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Order_Inventory = await _context.Order_Inventory .Include(o => o.Inventory) .Include(o => o.Order).FirstOrDefaultAsync(m => m.id == id); if (Order_Inventory == null) { return(NotFound()); } ViewData["InventoryId"] = new SelectList(_context.Inventory, "id", "id"); ViewData["OrderId"] = new SelectList(_context.Order, "id", "id"); return(Page()); }