Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var response = _beerServices.GetBeers();

            if (response.Success)
            {
                var model = new BeersViewModel
                {
                    Beers = response.Beers
                };

                return(View(model));
            }

            return(View("Error"));
        }
Ejemplo n.º 2
0
        public IActionResult Index()
        {
            CategorieBDD     categorieBDD = new CategorieBDD();
            List <Categorie> categories   = categorieBDD.GetAll();
            GammeBDD         gammeBDD     = new GammeBDD();
            List <Gamme>     gammes       = gammeBDD.GetAll();
            BeerBDD          beerBDD      = new BeerBDD();
            List <Beer>      beers        = beerBDD.GetAll();

            BeersViewModel model = new BeersViewModel();

            model.Beers      = beers;
            model.Categories = categories;
            model.Gammes     = gammes;
            return(View(model));
        }