Table of Contents

Interface ICacheContext

Namespace
Arc4u.Caching
Assembly
Arc4u.Caching.dll

Gives access to the caches declared in the Caching configuration section.

public interface ICacheContext

Properties

Default

Gets the default cache, i.e. the cache named by the Default entry of the Caching configuration section.

ICache Default { get; }

Property Value

ICache

Exceptions

InvalidOperationException

No cache is configured with the default name.

this[string]

Gets the cache with the given name, initializing it on first use when it is not flagged as auto start.

ICache this[string cacheName] { get; }

Parameters

cacheName string

The name of the cache, as defined in the configuration.

Property Value

ICache

The cache.

Exceptions

InvalidOperationException

No cache is configured with this name.

Methods

Exist(string)

Determines whether a cache with this name is declared in the configuration, whether it is already initialized or not.

bool Exist(string cacheName)

Parameters

cacheName string

The name of the cache.

Returns

bool

true when the cache exists; otherwise false.