C# Class SampleApplication.Controllers.FilterInjectionExample.DistributedCacheFilter

A filter that caches the result of an action in a distributed cache.
Inheritance: Ninject.Web.WebApi.Filter.AbstractActionFilter
Afficher le fichier Open project: ninject/Ninject.Web.WebApi

Méthodes publiques

Méthode Description
DistributedCacheFilter ( IDistributedCacheService cache, System.TimeSpan expirationTime ) : System

Initializes a new instance of the DistributedCacheFilter class.

OnActionExecuted ( System actionExecutedContext ) : void

Called after the action method executes. Saves the result to the cache.

OnActionExecuting ( System.Web.Http.Controllers.HttpActionContext actionContext ) : void

Called before an action method executes. Gets the cached result if available.

Private Methods

Méthode Description
GetKey ( HttpActionDescriptor actionDescriptor ) : string

Gets the key from the action descriptor.

Method Details

DistributedCacheFilter() public méthode

Initializes a new instance of the DistributedCacheFilter class.
public DistributedCacheFilter ( IDistributedCacheService cache, System.TimeSpan expirationTime ) : System
cache IDistributedCacheService The cache.
expirationTime System.TimeSpan The expiration time.
Résultat System

OnActionExecuted() public méthode

Called after the action method executes. Saves the result to the cache.
public OnActionExecuted ( System actionExecutedContext ) : void
actionExecutedContext System The action executed context.
Résultat void

OnActionExecuting() public méthode

Called before an action method executes. Gets the cached result if available.
public OnActionExecuting ( System.Web.Http.Controllers.HttpActionContext actionContext ) : void
actionContext System.Web.Http.Controllers.HttpActionContext The action Context.
Résultat void