public async Task <IActionResult> Index() { return(View(new HomepageViewModel { Cases = await _caseRepository.GetHomepageItems("nl"), Solutions = await _solutionRepository.GetAll().ToListAsync(), CarouselBlock = await _blockRepository.GetHomepageCarousel(), NewsItems = await _newsItemRepository.GetHomepageItems("nl") })); }
public async Task <IActionResult> Index() { var language = HttpContext?.Features?.Get <IRequestCultureFeature>()?.RequestCulture?.Culture ?.TwoLetterISOLanguageName ?? "nl"; var customers = (await _customerRepository.GetAll()).Where(c => c.Enabled && !c.Deleted).Take(12).ToList(); var cases = await _caseRepository.GetHomepageItems(language); var solutions = await _solutionRepository.GetAll().Where(s => s.Language == language).OrderBy(s => s.HomepageOrder).ToListAsync(); var carousel = await _blockRepository.GetHomepageCarousel(); var newsItems = await _newsItemRepository.GetHomepageItems(language); return(View(new HomeViewModel { Customers = customers, Cases = cases, Solutions = solutions, CarouselBlock = carousel, NewsItems = newsItems, })); }