Merge branch 'v9/dev' into v9/remove-system.configuration

This commit is contained in:
Warren Buckley
2021-08-11 14:08:52 +01:00
3 changed files with 9 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ namespace Umbraco.Extensions
/// <param name="htmlHelper"></param>
/// <param name="partialViewName"></param>
/// <param name="model"></param>
/// <param name="cachedSeconds"></param>
/// <param name="cacheTimeout"></param>
/// <param name="cacheKey">used to cache the partial view, this key could change if it is cached by page or by member</param>
/// <param name="viewData"></param>
/// <returns></returns>
@@ -30,7 +30,7 @@ namespace Umbraco.Extensions
IHtmlHelper htmlHelper,
string partialViewName,
object model,
int cachedSeconds,
TimeSpan cacheTimeout,
string cacheKey,
ViewDataDictionary viewData = null)
{
@@ -41,10 +41,12 @@ namespace Umbraco.Extensions
return htmlHelper.Partial(partialViewName, model, viewData);
}
return appCaches.RuntimeCache.GetCacheItem<IHtmlContent>(
var result = appCaches.RuntimeCache.GetCacheItem<IHtmlContent>(
CoreCacheHelperExtensions.PartialViewCacheKey + cacheKey,
() => htmlHelper.Partial(partialViewName, model, viewData),
timeout: new TimeSpan(0, 0, 0, cachedSeconds));
() => new HtmlString(htmlHelper.Partial(partialViewName, model, viewData).ToHtmlString()),
timeout: cacheTimeout);
return result;
}
}

View File

@@ -88,7 +88,7 @@ namespace Umbraco.Extensions
this IHtmlHelper htmlHelper,
string partialViewName,
object model,
int cachedSeconds,
TimeSpan cacheTimeout,
bool cacheByPage = false,
bool cacheByMember = false,
ViewDataDictionary viewData = null,
@@ -129,7 +129,7 @@ namespace Umbraco.Extensions
var appCaches = GetRequiredService<AppCaches>(htmlHelper);
var hostingEnvironment = GetRequiredService<IHostingEnvironment>(htmlHelper);
return appCaches.CachedPartialView(hostingEnvironment, htmlHelper, partialViewName, model, cachedSeconds, cacheKey.ToString(), viewData);
return appCaches.CachedPartialView(hostingEnvironment, htmlHelper, partialViewName, model, cacheTimeout, cacheKey.ToString(), viewData);
}
// public static IHtmlContent EditorFor<T>(this IHtmlHelper htmlHelper, string templateName = "", string htmlFieldName = "", object additionalViewData = null)