Table of Contents

Class CacheHelperExtensions

Namespace
Umbraco.Extensions
Assembly
Umbraco.Web.Common.dll

Extension methods for the cache helper

public static class CacheHelperExtensions
Inheritance
CacheHelperExtensions
Inherited Members

Methods

CachedPartialView(AppCaches, IHostingEnvironment, IUmbracoContext, IHtmlHelper, string, object, TimeSpan, string, ViewDataDictionary?)

Outputs and caches a partial view in MVC

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

appCaches AppCaches
hostingEnvironment IHostingEnvironment
umbracoContext IUmbracoContext
htmlHelper IHtmlHelper
partialViewName string
model object
cacheTimeout TimeSpan
cacheKey string

used to cache the partial view, this key could change if it is cached by page or by member

viewData ViewDataDictionary

Returns

IHtmlContent