Open sandboxFocus

Class CacheItem

Represents an item being added to the cache.

Inheritance
CacheItem
Implements
Namespace: PostSharp.Patterns.Caching.Implementation
Assembly: PostSharp.Patterns.Caching.dll
Syntax
[ImportSerializer(typeof(ImmutableList<>), typeof(ImmutableListPortableSerializer<>))]
[Serializer(typeof(CacheItem.Serializer))]
public sealed class CacheItem : IEquatable<CacheItem>

Constructors

Name Description
CacheItem(PortableFormatterConstructorContext)
CacheItem(object, IReadOnlyList<object>, IImmutableList<string>, CacheItemConfiguration)

Initializes a new CacheItem and specifies the Tags list.

CacheItem(object, IImmutableList<string>, CacheItemConfiguration)

Initializes a new CacheItem without specifying the Tags list.

Properties

Name Description
Configuration

Gets the CacheItemConfiguration for the current item, or null to use the default configuration.

Dependencies

Gets the list of dependencies of the current item, or null if there is no dependency.

Tags

Gets a list of tags, i.e. additional values to be cached, typically set by backend enhancers.

Timestamp

Gets the time when the item was instantiated. This is useful in non-blocking cache handling, when a set request might be processed several seconds after it has been ordered.

Value

Gets the value to be cached (null is a valid value).

Methods

Name Description
Equals(CacheItem)

Determines whether the current CacheItem is structurally equal to another CacheItem.

Equals(object)
GetHashCode()

Operators

Name Description
operator ==(CacheItem, CacheItem)

Determines whether two instances of the CacheItem class are structurally equal.

operator !=(CacheItem, CacheItem)

Determines whether two instances of the CacheItem class are structurally different.