Builds cache item keys and dependency keys.
Implements
Namespace: PostSharp.Patterns.Caching.Implementation
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public class CacheKeyBuilder : IDisposableConstructors
| Name | Description |
|---|---|
| CacheKeyBuilder() | Initializes a new CacheKeyBuilder with a default maximal key lenght of 2048 characters and no key compression. |
| CacheKeyBuilder(int) | Initializes a new CacheKeyBuilder and specifies the maximal key lenght and no key compression. |
| CacheKeyBuilder(int, CacheKeyHashingAlgorithm, int) | Initializes a new CacheKeyBuilder and specifies the maximal key lenght and compressing threshold. |
Properties
| Name | Description |
|---|---|
| HashingAlgorithm | Gets the algorithm used to compress the key if its length is above KeyCompressingThreshold. |
| IgnoredParameterSentinel | A sentinel object that means that the parameter is not a part of the cache key, and should be ignored. |
| KeyCompressingThreshold | Gets the lenght above which a key will be compressed if HashingAlgorithm is not None. |
| 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(MethodInfo, IList<object>, object) | Builds a cache key for a given method call. |
| CompressKey(UnsafeStringBuilder, bool, int) | Compresses the key is necessary. |
| Dispose() | |
| Dispose(bool) | Disposes the current object. |
| GetCachedMethodInfo(MethodInfo) | Gets the CachedMethodInfo for a given MethodInfo. |
| HashBuffer(ReadOnlySpan<byte>) | Hashes a buffer using HashingAlgorithm. |