Exemplo n.º 1
0
 // GET: Coffee list
 public ActionResult CoffeeList(string eircode)
 {
     //string res = eircode
     var viewModel = new CoffeeListData();
     viewModel.coffeeStores = db.CoffeeStores.Include(c => c.Drinks).ToList();
     if (eircode != null)
     {
         ViewBag.Eircode = eircode;
         viewModel.drinks = viewModel.coffeeStores.Where(c => c.Eircode == eircode).Single().Drinks;
     }
     return View(viewModel);
 }
Exemplo n.º 2
0
        // GET: Coffee list
        public ActionResult CoffeeList(string eircode)
        {
            //string res = eircode
            var viewModel = new CoffeeListData();

            viewModel.coffeeStores = db.CoffeeStores.Include(c => c.Drinks).ToList();
            if (eircode != null)
            {
                ViewBag.Eircode  = eircode;
                viewModel.drinks = viewModel.coffeeStores.Where(c => c.Eircode == eircode).Single().Drinks;
            }
            return(View(viewModel));
        }