Пример #1
0
        public ActionResult GetContent(Controller controller, Webpage webpage, Func <IHtmlHelper, MvcHtmlString> func,
                                       object queryData = null)
        {
            // This will only exist if the previous request explicitly stated to cache-bust (e.g. form submission)
            var doNotCache = controller?.TempData?[DoNotCacheAttribute.TempDataKey] is bool b && b;

            // if it's explicit, we always pass a non-caching CachingInfo instance to the service, so the page is rendered as per usual
            var cachingInfo = doNotCache ? CachingInfo.DoNotCache : _getWebpageCachingInfo.Get(webpage, queryData);

            return(_htmlCacheService.GetContent(controller, cachingInfo, func));
        }
 public ActionResult Query([IoCModelBinder(typeof(ProductSearchQueryModelBinder))] ProductSearchQuery query)
 {
     return(_htmlCacheService.GetContent(this, _productSearchIndexService.GetCachingInfo(query, "-query"),
                                         helper => helper.Action("QueryInternal", new { query })));
 }
Пример #3
0
 public ActionResult GetContent(Controller controller, Widget widget, Func <HtmlHelper, MvcHtmlString> func)
 {
     return(_htmlCacheService.GetContent(controller, _getWidgetCachingInfo.Get(widget), func));
 }