Exemplo n.º 1
0
 public ActionResult GetContent(IHtmlHelper helper, CachingInfo cachingInfo, Func <IHtmlHelper, MvcHtmlString> func)
 {
     return(_cacheManager.Get(cachingInfo.CacheKey, () => new ContentResult
     {
         Content = func(helper).ToString()
     }, cachingInfo.ShouldCache ? cachingInfo.TimeToCache : TimeSpan.Zero, cachingInfo.ExpiryType));
 }
Exemplo n.º 2
0
        public static MvcHtmlString GetCached(this HtmlHelper helper, CachingInfo cachingInfo,
                                              Func <HtmlHelper, MvcHtmlString> func)
        {
            var wrappedHtml = helper.GetWrappedHtml();

            return(wrappedHtml.Get <IHtmlCacheService>().GetString(wrappedHtml, cachingInfo, htmlHelper => func(helper)));
        }
Exemplo n.º 3
0
 public MvcHtmlString GetString(IHtmlHelper helper, CachingInfo cachingInfo, Func <IHtmlHelper, MvcHtmlString> func)
 {
     return(_cacheManager.Get(cachingInfo.CacheKey, () => func(helper),
                              cachingInfo.ShouldCache ? cachingInfo.TimeToCache : TimeSpan.Zero, cachingInfo.ExpiryType));
 }
Exemplo n.º 4
0
 public static MvcHtmlString GetCached(this HtmlHelper helper, CachingInfo cachingInfo,
                                       Func <HtmlHelper, MvcHtmlString> func)
 {
     return(MrCMSApplication.Get <IHtmlCacheService>().GetString(helper, cachingInfo, func));
 }