Table of Contents

Class CacheEntry

Namespace
Cuemon.Runtime.Caching
Assembly
Cuemon.Runtime.Caching.dll

Represents an individual cache entry in the cache.

public class CacheEntry
Inheritance
Object
CacheEntry

Constructors

CacheEntry(String, Object, String)

Initializes a new instance of the CacheEntry class.

public CacheEntry(string key, object value, string ns = null)

Parameters

key String

The unique identifier of the cache.

value Object

The stored value of the cache.

ns String

The optional namespace that provides a scope to the cache.

Exceptions

System.ArgumentNullException

key cannot be null.

Fields

NoScope

Represents a cache with a global scope, eg. no namespace.

public const string NoScope = null

Field Value

String

Properties

Accessed

Gets the UTC date time value from when this CacheEntry was last accessed.

public DateTime Accessed { get; }

Property Value

DateTime

The UTC date time value from when this CacheEntry was last accessed.

CanExpire

Gets a value indicating whether this CacheEntry can expire.

public bool CanExpire { get; }

Property Value

Boolean

true if this CacheEntry can expire; otherwise, false.

Inserted

Gets the UTC date time value from when this CacheEntry was inserted.

public DateTime Inserted { get; }

Property Value

DateTime

The UTC date time value from when this CacheEntry was inserted.

Invalidation

Gets the cache invalidation of this CacheEntry.

public CacheInvalidation Invalidation { get; }

Property Value

CacheInvalidation

The cache invalidation of this CacheEntry.

Key

Gets the unique identifier of this CacheEntry.

public string Key { get; }

Property Value

String

The unique identifier of this CacheEntry.

Namespace

Gets the optional namespace that provides a scope to this CacheEntry.

public string Namespace { get; }

Property Value

String

The optional namespace that provides a scope to this CacheEntry.

Value

Gets the stored value of this CacheEntry.

public object Value { get; set; }

Property Value

Object

The stored value of this CacheEntry.

Methods

HasExpired(DateTime)

Determines whether the specified time resolves this CacheEntry as expired.

public bool HasExpired(DateTime time)

Parameters

time DateTime

The date and time to evaluate against.

Returns

Boolean

true if the specified time resolves this CacheEntry as expired; otherwise, false.

OnExpiredRaised(CacheEntryEventArgs)

Raises the Expired event.

protected virtual void OnExpiredRaised(CacheEntryEventArgs e)

Parameters

e CacheEntryEventArgs

The CacheEntryEventArgs instance containing the event data.

ToString()

Returns a System.String that represents this instance.

public override string ToString()

Returns

String

A System.String that represents this instance.

Events

Expired

Occurs when a CacheEntry object with an associated Dependency has expired.

public event EventHandler<CacheEntryEventArgs> Expired

Event Type

EventHandler<CacheEntryEventArgs>