public async Task <ActionResult> Menu() { ViewBag.BreadId = new SelectList(db.Breads, "Id", "NamePrice"); ViewBag.CheeseId = new SelectList(db.Cheeses, "Id", "NamePrice"); ViewBag.MeatId = new SelectList(db.Meats, "Id", "NamePrice"); ViewBag.SauceId = new SelectList(db.Sauces, "Id", "NamePrice"); ViewBag.VeggieId = new SelectList(db.Veggies, "Id", "NamePrice"); var model = new BurgerDrinkViewModel { Burgers = await BurgerServices.GetBurgersAsync(), Drinks = await DrinkServices.GetDrinksAsync() }; return(View(model)); }
// GET: api/BurgerApi public async Task <List <Burger> > GetBurgers() { return(await BurgerServices.GetBurgersAsync()); }
// GET: Burger public async Task <ActionResult> Index() { return(View(await BurgerServices.GetBurgersAsync())); }