Class CachingViewEnginesWrapper

Encapsulates System.Web.Mvc.ViewEngineCollection. It has the addition that it caches "no-hits" (when runing in release mode) unlike the ordinary ViewEngine.Engines.

Inheritance
System.Object
CachingViewEnginesWrapper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web.Mvc
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class CachingViewEnginesWrapper

Constructors

CachingViewEnginesWrapper(ViewEngineCollection, IObjectInstanceCache)

Initializes a new instance of the CachingViewEnginesWrapper class.

Declaration
public CachingViewEnginesWrapper(ViewEngineCollection viewEngines, IObjectInstanceCache cache)
Parameters
Type Name Description
System.Web.Mvc.ViewEngineCollection viewEngines

The view engines.

IObjectInstanceCache cache

The cache.

Methods

FindInternal(HttpContextBase, Func<String>, Func<ViewEngineResult>)

The actual implementation. It delegates calls to the wrapped System.Web.Mvc.ViewEngineCollection but caches no-hits when running in release mode.

Declaration
protected virtual ViewEngineResult FindInternal(HttpContextBase context, Func<string> cacheKeyResolver, Func<ViewEngineResult> viewResolver)
Parameters
Type Name Description
System.Web.HttpContextBase context

The context.

System.Func<System.String> cacheKeyResolver

The cache key resolver.

System.Func<System.Web.Mvc.ViewEngineResult> viewResolver

The view resolver.

Returns
Type Description
System.Web.Mvc.ViewEngineResult

FindPartialView(ControllerContext, String)

Finds the partial view with given name.

Declaration
public virtual ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName)
Parameters
Type Name Description
System.Web.Mvc.ControllerContext controllerContext

The controller context.

System.String partialViewName

Partial name of the view.

Returns
Type Description
System.Web.Mvc.ViewEngineResult

FindView(ControllerContext, String, String)

Finds the view with given name.

Declaration
public virtual ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName)
Parameters
Type Name Description
System.Web.Mvc.ControllerContext controllerContext

The controller context.

System.String viewName

Name of the view.

System.String masterName

Name of the master.

Returns
Type Description
System.Web.Mvc.ViewEngineResult

Extension Methods