MetalamaAPI documentationPatterns APIMetalama.​Patterns.​Caching.​FormattersCache­Key­Builder
Open sandboxFocus

CacheKeyBuilder Class

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

Inheritance
System.Object
CacheKeyBuilder
Implements
System.IDisposable
ICacheKeyBuilder
Namespace: Metalama.Patterns.Caching.Formatters
Assembly: Metalama.Patterns.Caching.dll
Syntax
public class CacheKeyBuilder : Object, 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 System.Object to an UnsafeStringBuilder.

AppendType(UnsafeStringBuilder, Type)

Appends a System.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(Boolean)

Disposes the current object.