public CacheManagerConfiguration(
            CacheUpdateMode mode        = CacheUpdateMode.None,
            int maxRetries              = int.MaxValue,
            int retryTimeout            = 10,
            Type backPlateType          = null,
            string backPlateName        = null,
            ICacheSerializer serializer = null)
            : this()
        {
            this.CacheUpdateMode = mode;
            this.MaxRetries      = maxRetries;
            this.RetryTimeout    = retryTimeout;
            this.BackPlateType   = backPlateType;
            this.BackPlateName   = backPlateName;
#if !PORTABLE && !DOTNET5_2
            // default to binary serialization if available
            this.CacheSerializer = serializer ?? new BinaryCacheSerializer();
#else
            this.CacheSerializer = serializer;
#endif
        }
        public CacheManagerConfiguration(
            CacheUpdateMode mode = CacheUpdateMode.None,
            int maxRetries = int.MaxValue,
            int retryTimeout = 10,
            Type backPlateType = null,
            string backPlateConfigurationKey = null,
            ICacheSerializer serializer = null)
            : this()
        {
            this.CacheUpdateMode = mode;
            this.MaxRetries = maxRetries;
            this.RetryTimeout = retryTimeout;
            this.BackPlateType = backPlateType;
            this.BackPlateConfigurationKey = backPlateConfigurationKey;
#if !PORTABLE && !DOTNET5_2
            // default to binary serialization if available
            this.CacheSerializer = serializer ?? new BinaryCacheSerializer();
#else
            this.CacheSerializer = serializer;
#endif
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sets the update mode of the cache.
 /// <para>If nothing is set, the default will be <c>CacheUpdateMode.None</c>.</para>
 /// </summary>
 /// <param name="updateMode">The update mode.</param>
 /// <returns>The builder part.</returns>
 /// <seealso cref="CacheUpdateMode"/>
 public ConfigurationBuilderCachePart WithUpdateMode(CacheUpdateMode updateMode)
 {
     this.Configuration.UpdateMode = updateMode;
     return this;
 }
 /// <summary>
 /// Sets the update mode of the cache.
 /// <para>If nothing is set, the default will be <c>CacheUpdateMode.None</c>.</para>
 /// </summary>
 /// <param name="updateMode">The update mode.</param>
 /// <returns>The builder part.</returns>
 /// <seealso cref="CacheUpdateMode"/>
 public ConfigurationBuilderCachePart WithUpdateMode(CacheUpdateMode updateMode)
 {
     Configuration.UpdateMode = updateMode;
     return(this);
 }