C# Class Ninject.Activation.Caching.Cache

Tracks instances for re-use in certain scopes.
Inheritance: Ninject.Components.NinjectComponent, ICache
Datei anzeigen Open project: Haacked/ninject Class Usage Examples

Public Methods

Method Description
Cache ( IPipeline pipeline, ICachePruner cachePruner ) : System

Initializes a new instance of the Cache class.

Clear ( ) : void

Immediately deactivates and removes all instances in the cache, regardless of scope.

Dispose ( bool disposing ) : void

Releases resources held by the object.

DisposeRequestScoped ( HttpContext httpContext ) : void

Disposes request scoped IDisposable instances

Prune ( ) : void

Removes instances from the cache which should no longer be re-used.

Remember ( IContext context, InstanceReference reference ) : void

Stores the specified context in the cache.

TryGet ( IContext context ) : object

Tries to retrieve an instance to re-use in the specified context.

Private Methods

Method Description
Forget ( CacheEntry entry ) : void
GetEntriesCache ( HttpContext httpContext ) : CacheEntry>.Multimap
GetItemFromCache ( IContext context, object scope, CacheEntry>.Multimap entries ) : object
GetRequestScopedDisposables ( HttpContext httpContext ) : ICollection

Method Details

Cache() public method

Initializes a new instance of the Cache class.
public Cache ( IPipeline pipeline, ICachePruner cachePruner ) : System
pipeline IPipeline The pipeline component.
cachePruner ICachePruner The cache pruner component.
return System

Clear() public method

Immediately deactivates and removes all instances in the cache, regardless of scope.
public Clear ( ) : void
return void

Dispose() public method

Releases resources held by the object.
public Dispose ( bool disposing ) : void
disposing bool
return void

DisposeRequestScoped() public method

Disposes request scoped IDisposable instances
public DisposeRequestScoped ( HttpContext httpContext ) : void
httpContext HttpContext
return void

Prune() public method

Removes instances from the cache which should no longer be re-used.
public Prune ( ) : void
return void

Remember() public method

Stores the specified context in the cache.
public Remember ( IContext context, InstanceReference reference ) : void
context IContext The context to store.
reference InstanceReference The instance reference.
return void

TryGet() public method

Tries to retrieve an instance to re-use in the specified context.
public TryGet ( IContext context ) : object
context IContext The context that is being activated.
return object