Example #1
0
        public async Task <IActionResult> OnPostAsync(int OrderId, int OrderItemId, int BeverageOrderId)
        {
            BeverageOrder = await _context.BeverageOrder.FindAsync(BeverageOrderId);

            if (BeverageOrder != null)
            {
                _context.BeverageOrder.Remove(BeverageOrder);
                await _context.SaveChangesAsync();
            }

            return(Redirect($"/Order/Details?OrderId={OrderId}&OrderItemId={OrderItemId}"));
        }
Example #2
0
        public async Task <IActionResult> OnGetAsync(int OrderId, int OrderItemId, int BeverageOrderId)
        {
            BeverageOrder = await _context.BeverageOrder
                            .Include(b => b.Beverage)
                            .Include(b => b.OrderItem).FirstOrDefaultAsync(m => m.BeverageOrderId == BeverageOrderId);

            if (BeverageOrder == null)
            {
                return(NotFound());
            }
            return(Page());
        }