C# Class Aspectacular.RequestCache

Caches data for the duration of the HTTP request processing. Should be used together with [InvariantReturn] attribute applied to methods and classes whose results can be cached.
No explicit cleanup/invalidation is required as cached data is dropped at the end of the request processing. This caching mechanism could be used to eliminate same queries to the database done within the scope of a single page. Please note that method unique signature involves a very slow method parameter evaluation. and therefore only methods with high likelihood of repeated calls should be cached.
Inheritance: ICacheProvider
Datei anzeigen Open project: vgribok/Aspectacular

Protected Properties

Property Type Description
requestCacher RequestCache

Public Methods

Method Description
Get ( ) : RequestCache

Factory returning instance of the http request-level cache provider for caching aspect.

Set ( string key, object val ) : void
TryGet ( string key, object &val ) : bool

Protected Methods

Method Description
RequestCache ( ) : System.Web

Please use static Get() factory method instead of the constructor.

Method Details

Get() public static method

Factory returning instance of the http request-level cache provider for caching aspect.
public static Get ( ) : RequestCache
return RequestCache

RequestCache() protected method

Please use static Get() factory method instead of the constructor.
protected RequestCache ( ) : System.Web
return System.Web

Set() public method

public Set ( string key, object val ) : void
key string
val object
return void

TryGet() public method

public TryGet ( string key, object &val ) : bool
key string
val object
return bool

Property Details

requestCacher protected_oe static_oe property

No reason to instantiate destroy it - it has no state and works on the current request.
protected static RequestCache,Aspectacular requestCacher
return RequestCache