Interface ICache
Tracks instances for re-use in certain scopes.
Namespace: Telerik.JustMock.AutoMock.Ninject.Activation.Caching
Assembly: Telerik.JustMock.dll
Syntax
public interface ICache : INinjectComponent, IDisposable, IPruneable
Properties
Count
Gets the number of entries currently stored in the cache.
Declaration
int Count { get; }
Property Value
System.Int32
|
Methods
Clear()
Immediately deactivates and removes all instances in the cache, regardless of scope.
Declaration
void Clear()
Clear(Object)
Immediately deactivates and removes all instances in the cache that are owned by the specified scope.
Declaration
void Clear(object scope)
Parameters
System.Object
scope
The scope whose instances should be deactivated. |
Release(Object)
Deactivates and releases the specified instance from the cache.
Declaration
bool Release(object instance)
Parameters
System.Object
instance
The instance to release. |
Returns
System.Boolean
langword_csharp_True if the instance was found and released; otherwise false. |
Remember(IContext, InstanceReference)
Stores the specified instance in the cache.
Declaration
void Remember(IContext context, InstanceReference reference)
Parameters
IContext
context
The context to store. |
InstanceReference
reference
The instance reference. |
TryGet(IContext)
Tries to retrieve an instance to re-use in the specified context.
Declaration
object TryGet(IContext context)
Parameters
IContext
context
The context that is being activated. |
Returns
System.Object
The instance for re-use, or null if none has been stored. |