public ActionResult Index() { var selectedPage = GetProperties().SelectedCafes?.FirstOrDefault(); var cafe = (selectedPage != null) ? mCafeRepository.GetCafeByGuid(selectedPage.NodeGuid) : null; mOutputCacheDependencies.AddDependencyOnPage <Cafe>(cafe?.DocumentID ?? 0); return(PartialView("Widgets/_CafeCardWidget", CafeCardViewModel.GetViewModel(cafe))); }
public ActionResult Index() { var selectedPage = componentPropertiesRetriever.Retrieve <CafeCardProperties>().SelectedCafes.FirstOrDefault(); var cafe = (selectedPage != null) ? repository.GetCafeByGuid(selectedPage.NodeGuid) : null; outputCacheDependencies.AddDependencyOnPage(cafe); return(PartialView("Widgets/_CafeCardWidget", CafeCardViewModel.GetViewModel(cafe, attachmentUrlRetriever))); }