コード例 #1
0
        public async Task <IActionResult> OrderForm(Desserts d)
        {
            if (ModelState.IsValid)
            {
                await DessertsDb.UpdateDessertAsync(_context, d);

                TempData["WasSuccessful"] = "You have successfully ordered items for DisneyCafe";
                return(RedirectToAction("Index", "Home"));
            }

            return(View(d));
        }
コード例 #2
0
        public async Task <IActionResult> OrderForm(int id)
        {
            Desserts dessert = await DessertsDb.GetDessertsById(_context, id);

            return(View(dessert));
        }
コード例 #3
0
        public async Task <IActionResult> Index()
        {
            List <Desserts> desserts = await DessertsDb.GetDessertsAsync(_context);

            return(View(desserts));
        }