Пример #1
0
        public async Task <IActionResult> Index()
        {
            var bars          = (await _barServices.LoadNewestBars()).Select(b => b.MapToViewModel()).ToList();
            var cocktails     = (await _cocktailServices.LoadNewestCocktails()).Select(c => c.MapToViewModel()).ToList();
            var homeViewModel = new HomeViewModel
            {
                Bars      = bars,
                Cocktails = cocktails,
            };

            return(View(homeViewModel));
        }