Open sandboxFocus

Class CacheKeyBuilder

Builds cache item keys and dependency keys. Implementation of ICacheKeyBuilder.

Inheritance
CacheKeyBuilder
Namespace: Metalama.Patterns.Caching.Formatters
Assembly: Metalama.Patterns.Caching.dll
Syntax
public class CacheKeyBuilder : IDisposable, ICacheKeyBuilder

Constructors

Name Description
CacheKeyBuilder(IFormatterRepository, CacheKeyBuilderOptions)

Initializes a new instance of the CacheKeyBuilder class specifying the maximal key size and optionally a IFormatterRepository.

Properties

Name Description
Formatters

Gets the formatters used to build the caching key.

IgnoredParameterSentinel

Gets a sentinel object that means that the parameter is not a part of the cache key, and should be ignored.

MaxKeySize

Gets the maximal number of characters in cache keys.

Methods

Name Description
AppendArgument(UnsafeStringBuilder, Type, object?)

Appends a method argument to an UnsafeStringBuilder. To avoid ambiguities between different overloads of the same method, the default implementation appends both the parameter type and the value key.

AppendMethod(UnsafeStringBuilder, MethodInfo)

Appends the method name and generic arguments to an UnsafeStringBuilder.

AppendObject(UnsafeStringBuilder, object)

Appends a string representing an object to an UnsafeStringBuilder.

AppendType(UnsafeStringBuilder, Type)

Appends a Type name to an UnsafeStringBuilder.

BuildDependencyKey(object)

Builds a dependency key for a given object.

BuildMethodKey(CachedMethodMetadata, object?, IList<object?>)

Builds a cache key for a given method call.

Dispose()
Dispose(bool)

Disposes the current object.