PostSharp.ILAPI ReferencePost­Sharp.​Patterns.​Caching.​Backends.​RedisRedis­Caching­Backend­Configuration
Open sandboxFocus

RedisCachingBackendConfiguration Class

Configuration for RedisCachingBackend.

Inheritance
RedisCachingBackendConfiguration
Implements
System.ICloneable
Namespace: PostSharp.Patterns.Caching.Backends.Redis
Assembly: PostSharp.Patterns.Caching.Backends.Redis.dll
Syntax
public class RedisCachingBackendConfiguration : Object

Constructors

Name Description
RedisCachingBackendConfiguration() PostSharp.Patterns.Caching.Backends.Redis.RedisCachingBackendConfiguration

Properties

Name Description
ConnectionTimeout

Gets or sets the time that the Redis backend will wait for a Redis connection. (When you create a new Redis backend, if it doesn't connect to a Redis server in this timeout, a TimeoutException is thrown.)

CreateSerializer

Gets or sets a function that creates the serializer used to serialize objects into byte arrays (and conversely). The default value is null, which means that JsonCachingSerializer will be used.

Database

Gets the index of the database to use. The default value is -1 (automatic selection).

DefaultExpiration

Gets or sets the default expiration time of cached items. All items that don't have an explicit expiration time are automatically expired according to the value of this property, unless they have the NotRemovable priority. The default value is 1 day.

IsFrozen

Determines whether the current instance is frozen (i.e. read-only).

IsLocallyCached

Determines whether a MemoryCachingBackend should be added in front of the RedisCachingBackend.

KeyPrefix

Gets the prefix for the key of all Redis items created by the RedisCachingBackend. The default value is cache.

OwnsConnection

Determines whether the RedisCachingBackend should dispose the Redis connection when the RedisCachingBackend itself is disposed.

SupportsDependencies

Determines whether the RedisCachingBackend should support dependencies. When this property is used, the PostSharp.Patterns.Caching.Backends.Redis.DependenciesRedisCachingBackend class is used instead of RedisCachingBackend. When dependencies are enabled, at least one instance of the RedisCacheDependencyGarbageCollector MUST run.

TransactionMaxRetries

Gets or sets the number of times Redis transactions are retried when they fail due to a data conflict, before an exception is raised. The default value is 5.

Methods

Name Description
CheckFrozen()

Throws an InvalidOperationException if the object has been frozen.

Clone()

Returns a non-frozen clone of the current instance.