Class CacheHelperExtensions
Extension methods for the cache helper
Inheritance
System.Object
Namespace: Umbraco.Extensions
Assembly: Umbraco.Web.Common.dll
Syntax
public static class CacheHelperExtensions
Methods
View SourceCachedPartialView(AppCaches, IHostingEnvironment, IUmbracoContext, IHtmlHelper, String, Object, TimeSpan, String, ViewDataDictionary)
Outputs and caches a partial view in MVC
Declaration
public static IHtmlContent CachedPartialView(this AppCaches appCaches, IHostingEnvironment hostingEnvironment, IUmbracoContext umbracoContext, IHtmlHelper htmlHelper, string partialViewName, object model, TimeSpan cacheTimeout, string cacheKey, ViewDataDictionary viewData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AppCaches | appCaches | |
| IHostingEnvironment | hostingEnvironment | |
| IUmbracoContext | umbracoContext | |
| Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper | htmlHelper | |
| System.String | partialViewName | |
| System.Object | model | |
| TimeSpan | cacheTimeout | |
| System.String | cacheKey | used to cache the partial view, this key could change if it is cached by page or by member |
| Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary | viewData |
Returns
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent |