• CacheManager
  • Documentation
  • Api Docs
  • MichaCo.net
    Show / Hide Table of Contents

    Class ConfigurationBuilderCachePart

    Used to build a CacheManagerConfiguration.

    Inheritance
    Object
    ConfigurationBuilderCachePart
    ConfigurationBuilder
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace:CacheManager.Core
    Assembly:CacheManager.Core.dll
    Syntax
    public class ConfigurationBuilderCachePart

    Methods

    | Improve this Doc View Source

    Build()

    Hands back the new CacheManagerConfiguration instance.

    Declaration
    public ICacheManagerConfiguration Build()
    Returns
    Type Description
    ICacheManagerConfiguration

    The ICacheManagerConfiguration.

    | Improve this Doc View Source

    WithBackplane(Type, String, Object[])

    Configures the backplane for the cache manager.

    This is an optional feature. If specified, see the documentation for the backplaneType. The configurationKey might be used to reference another configuration item.

    If a backplane is defined, at least one cache handle must be marked as backplane source. The cache manager then will try to synchronize multiple instances of the same configuration.

    Declaration
    public ConfigurationBuilderCachePart WithBackplane(Type backplaneType, string configurationKey, params object[] args)
    Parameters
    Type Name Description
    Type backplaneType

    The type of the backplane implementation.

    String configurationKey

    The name.

    Object[] args

    Additional arguments the type might need to get initialized.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The builder instance.

    Exceptions
    Type Condition
    ArgumentNullException

    If configurationKey is null.

    | Improve this Doc View Source

    WithBackplane(Type, String, String, Object[])

    Configures the backplane for the cache manager.

    This is an optional feature. If specified, see the documentation for the backplaneType. The configurationKey might be used to reference another configuration item.

    If a backplane is defined, at least one cache handle must be marked as backplane source. The cache manager then will try to synchronize multiple instances of the same configuration.

    Declaration
    public ConfigurationBuilderCachePart WithBackplane(Type backplaneType, string configurationKey, string channelName, params object[] args)
    Parameters
    Type Name Description
    Type backplaneType

    The type of the backplane implementation.

    String configurationKey

    The configuration key.

    String channelName

    The backplane channel name.

    Object[] args

    Additional arguments the type might need to get initialized.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The builder instance.

    Exceptions
    Type Condition
    ArgumentNullException

    If configurationKey or channelName is null.

    | Improve this Doc View Source

    WithBinarySerializer()

    Configures a BinaryCacheSerializer to be used for serialization and deserialization.

    Declaration
    public ConfigurationBuilderCachePart WithBinarySerializer()
    Returns
    Type Description
    ConfigurationBuilderCachePart

    The builder part.

    | Improve this Doc View Source

    WithBinarySerializer(BinaryFormatter, BinaryFormatter)

    Configures a BinaryCacheSerializer to be used for serialization and deserialization.

    Declaration
    public ConfigurationBuilderCachePart WithBinarySerializer(BinaryFormatter serializationFormatter, BinaryFormatter deserializationFormatter)
    Parameters
    Type Name Description
    BinaryFormatter serializationFormatter

    The BinaryFormatter for serialization.

    BinaryFormatter deserializationFormatter

    The BinaryFormatter for deserialization.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The builder part.

    | Improve this Doc View Source

    WithDictionaryHandle(Boolean)

    Adds a cache dictionary cache handle to the cache manager.

    Declaration
    public ConfigurationBuilderCacheHandlePart WithDictionaryHandle(bool isBackplaneSource = false)
    Parameters
    Type Name Description
    Boolean isBackplaneSource

    Set this to true if this cache handle should be the source of the backplane.

    This setting will be ignored if no backplane is configured.

    Returns
    Type Description
    ConfigurationBuilderCacheHandlePart

    The builder part.

    | Improve this Doc View Source

    WithDictionaryHandle(String, Boolean)

    Adds a cache dictionary cache handle to the cache manager.

    Declaration
    public ConfigurationBuilderCacheHandlePart WithDictionaryHandle(string handleName, bool isBackplaneSource = false)
    Parameters
    Type Name Description
    String handleName

    The name of the cache handle.

    Boolean isBackplaneSource

    Set this to true if this cache handle should be the source of the backplane.

    This setting will be ignored if no backplane is configured.

    Returns
    Type Description
    ConfigurationBuilderCacheHandlePart

    The builder part.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if handleName is null.

    | Improve this Doc View Source

    WithHandle(Type)

    Adds a cache handle with the given Type. The type must be an open generic.

    Declaration
    public ConfigurationBuilderCacheHandlePart WithHandle(Type cacheHandleBaseType)
    Parameters
    Type Name Description
    Type cacheHandleBaseType

    The cache handle type.

    Returns
    Type Description
    ConfigurationBuilderCacheHandlePart

    The builder part.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if handleName or cacheHandleBaseType are null.

    | Improve this Doc View Source

    WithHandle(Type, String)

    Adds a cache handle with the given Type and name. The type must be an open generic.

    Declaration
    public ConfigurationBuilderCacheHandlePart WithHandle(Type cacheHandleBaseType, string handleName)
    Parameters
    Type Name Description
    Type cacheHandleBaseType

    The cache handle type.

    String handleName

    The name to be used for the cache handle.

    Returns
    Type Description
    ConfigurationBuilderCacheHandlePart

    The builder part.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if handleName or cacheHandleBaseType are null.

    | Improve this Doc View Source

    WithHandle(Type, String, Boolean, Object[])

    Adds a cache handle with the given Type and name. The type must be an open generic.

    Declaration
    public ConfigurationBuilderCacheHandlePart WithHandle(Type cacheHandleBaseType, string handleName, bool isBackplaneSource, params object[] configurationTypes)
    Parameters
    Type Name Description
    Type cacheHandleBaseType

    The cache handle type.

    String handleName

    The name to be used for the cache handle.

    Boolean isBackplaneSource

    Set this to true if this cache handle should be the source of the backplane.

    This setting will be ignored if no backplane is configured.

    Object[] configurationTypes

    Internally used only.

    Returns
    Type Description
    ConfigurationBuilderCacheHandlePart

    The builder part.

    Exceptions
    Type Condition
    ArgumentNullException

    If handleName is null.

    InvalidOperationException

    Only one cache handle can be the backplane's source.

    ArgumentNullException

    Thrown if handleName or cacheHandleBaseType are null.

    | Improve this Doc View Source

    WithLogging(Type, Object[])

    Enables logging by setting the ILoggerFactory for the cache manager instance.

    Declaration
    public ConfigurationBuilderCachePart WithLogging(Type loggerFactoryType, params object[] args)
    Parameters
    Type Name Description
    Type loggerFactoryType

    The type of the logger factory.

    Object[] args

    Additional arguments the type might need to get initialized.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The builder part.

    | Improve this Doc View Source

    WithMaxRetries(Int32)

    Sets the maximum number of retries per action.

    Default is 50.

    Not every cache handle implements this, usually only distributed caches will use it.

    Declaration
    public ConfigurationBuilderCachePart WithMaxRetries(int retries)
    Parameters
    Type Name Description
    Int32 retries

    The maximum number of retries.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The configuration builder.

    Exceptions
    Type Condition
    InvalidOperationException

    Maximum number of retries must be greater than 0.

    | Improve this Doc View Source

    WithRetryTimeout(Int32)

    Sets the timeout between each retry of an action in milliseconds.

    Default is 100.

    Not every cache handle implements this, usually only distributed caches will use it.

    Declaration
    public ConfigurationBuilderCachePart WithRetryTimeout(int timeoutMillis)
    Parameters
    Type Name Description
    Int32 timeoutMillis

    The timeout in milliseconds.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The configuration builder.

    Exceptions
    Type Condition
    InvalidOperationException

    Retry timeout must be greater than or equal to zero.

    | Improve this Doc View Source

    WithSerializer(Type, Object[])

    Sets the serializer which should be used to serialize cache items.

    Declaration
    public ConfigurationBuilderCachePart WithSerializer(Type serializerType, params object[] args)
    Parameters
    Type Name Description
    Type serializerType

    The type of the serializer.

    Object[] args

    Additional arguments the type might need to get initialized.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The builder part.

    | Improve this Doc View Source

    WithUpdateMode(CacheUpdateMode)

    Sets the update mode of the cache.

    If nothing is set, the default will be CacheUpdateMode.None.

    Declaration
    public ConfigurationBuilderCachePart WithUpdateMode(CacheUpdateMode updateMode)
    Parameters
    Type Name Description
    CacheUpdateMode updateMode

    The update mode.

    Returns
    Type Description
    ConfigurationBuilderCachePart

    The builder part.

    See Also
    CacheUpdateMode

    Extension Methods

    MicrosoftMemoryCachingBuilderExtensions.WithMicrosoftMemoryCacheHandle(ConfigurationBuilderCachePart, Boolean)
    MicrosoftMemoryCachingBuilderExtensions.WithMicrosoftMemoryCacheHandle(ConfigurationBuilderCachePart, String, Boolean)
    MicrosoftMemoryCachingBuilderExtensions.WithMicrosoftMemoryCacheHandle(ConfigurationBuilderCachePart, String, MemoryCacheOptions)
    MicrosoftMemoryCachingBuilderExtensions.WithMicrosoftMemoryCacheHandle(ConfigurationBuilderCachePart, MemoryCacheOptions)
    MicrosoftMemoryCachingBuilderExtensions.WithMicrosoftMemoryCacheHandle(ConfigurationBuilderCachePart, String, Boolean, MemoryCacheOptions)
    BondConfigurationBuilderExtensions.WithBondCompactBinarySerializer(ConfigurationBuilderCachePart, Int32)
    BondConfigurationBuilderExtensions.WithBondFastBinarySerializer(ConfigurationBuilderCachePart, Int32)
    BondConfigurationBuilderExtensions.WithBondSimpleJsonSerializer(ConfigurationBuilderCachePart)
    RedisConfigurationBuilderExtensions.WithRedisConfiguration(ConfigurationBuilderCachePart, String, Action<RedisConfigurationBuilder>)
    RedisConfigurationBuilderExtensions.WithRedisConfiguration(ConfigurationBuilderCachePart, String, String, Int32, Boolean)
    RedisConfigurationBuilderExtensions.WithRedisConfiguration(ConfigurationBuilderCachePart, String, IConnectionMultiplexer, Int32, Boolean)
    RedisConfigurationBuilderExtensions.WithRedisBackplane(ConfigurationBuilderCachePart, String)
    RedisConfigurationBuilderExtensions.WithRedisBackplane(ConfigurationBuilderCachePart, String, String)
    RedisConfigurationBuilderExtensions.WithRedisCacheHandle(ConfigurationBuilderCachePart, String, Boolean)
    MemcachedConfigurationBuilderExtensions.WithMemcachedCacheHandle(ConfigurationBuilderCachePart, String, Boolean)
    MemcachedConfigurationBuilderExtensions.WithMemcachedCacheHandle(ConfigurationBuilderCachePart, MemcachedClient, Boolean)
    MemcachedConfigurationBuilderExtensions.WithMemcachedCacheHandle(ConfigurationBuilderCachePart, String, MemcachedClient, Boolean)
    MemcachedConfigurationBuilderExtensions.WithMemcachedCacheHandle(ConfigurationBuilderCachePart, MemcachedClientConfiguration, Boolean)
    MemcachedConfigurationBuilderExtensions.WithMemcachedCacheHandle(ConfigurationBuilderCachePart, String, MemcachedClientConfiguration, Boolean)
    ProtoBufConfigurationBuilderExtensions.WithProtoBufSerializer(ConfigurationBuilderCachePart)
    JsonConfigurationBuilderExtensions.WithJsonSerializer(ConfigurationBuilderCachePart)
    JsonConfigurationBuilderExtensions.WithJsonSerializer(ConfigurationBuilderCachePart, JsonSerializerSettings, JsonSerializerSettings)
    JsonConfigurationBuilderExtensions.WithGzJsonSerializer(ConfigurationBuilderCachePart)
    JsonConfigurationBuilderExtensions.WithGzJsonSerializer(ConfigurationBuilderCachePart, JsonSerializerSettings, JsonSerializerSettings)
    RuntimeCachingBuilderExtensions.WithSystemRuntimeCacheHandle(ConfigurationBuilderCachePart, Boolean)
    RuntimeCachingBuilderExtensions.WithSystemRuntimeCacheHandle(ConfigurationBuilderCachePart, String, Boolean)
    CouchbaseConfigurationBuilderExtensions.WithCouchbaseConfiguration(ConfigurationBuilderCachePart, String, ClientConfiguration)
    CouchbaseConfigurationBuilderExtensions.WithCouchbaseConfiguration(ConfigurationBuilderCachePart, String, ICouchbaseClientDefinition)
    CouchbaseConfigurationBuilderExtensions.WithCouchbaseCluster(ConfigurationBuilderCachePart, String, ICluster)
    CouchbaseConfigurationBuilderExtensions.WithCouchbaseCacheHandle(ConfigurationBuilderCachePart, String, String, Boolean)
    CouchbaseConfigurationBuilderExtensions.WithCouchbaseCacheHandle(ConfigurationBuilderCachePart, String, String, String, Boolean)
    WebConfigurationBuilderExtensions.WithSystemWebCacheHandle(ConfigurationBuilderCachePart, Boolean)
    WebConfigurationBuilderExtensions.WithSystemWebCacheHandle(ConfigurationBuilderCachePart, String, Boolean)
    MicrosoftLoggingBuilderExtensions.WithMicrosoftLogging(ConfigurationBuilderCachePart, Action<ILoggerFactory>)
    MicrosoftLoggingBuilderExtensions.WithMicrosoftLogging(ConfigurationBuilderCachePart, ILoggerFactory)
    MicrosoftLoggingBuilderExtensions.WithMicrosoftLogging(ConfigurationBuilderCachePart, IServiceCollection)
    • Improve this Doc
    • View Source
    © 2025 by Michael Conrad. All rights reserved. - MichaCo.net