@@ -48,31 +48,30 @@ public partial class DefaultCSRedisCachingProvider : EasyCachingAbstractProvider
48
48
/// </summary>
49
49
/// <param name="name">Name.</param>
50
50
/// <param name="clients">Clients.</param>
51
- /// <param name="serializer">Serializer .</param>
51
+ /// <param name="serializers">Serializers .</param>
52
52
/// <param name="options">Options.</param>
53
53
/// <param name="loggerFactory">Logger factory.</param>
54
54
public DefaultCSRedisCachingProvider (
55
55
string name ,
56
56
IEnumerable < EasyCachingCSRedisClient > clients ,
57
- IEasyCachingSerializer serializer ,
57
+ IEnumerable < IEasyCachingSerializer > serializers ,
58
58
RedisOptions options ,
59
59
ILoggerFactory loggerFactory = null )
60
60
{
61
61
this . _name = name ;
62
- this . _serializer = serializer ;
62
+ this . _serializer = serializers . FirstOrDefault ( x => x . Name . Equals ( _name ) ) ?? serializers . Single ( x => x . Name . Equals ( EasyCachingConstValue . DefaultSerializerName ) ) ;
63
63
this . _options = options ;
64
64
this . _logger = loggerFactory ? . CreateLogger < DefaultCSRedisCachingProvider > ( ) ;
65
65
this . _cache = clients . Single ( x => x . Name . Equals ( _name ) ) ;
66
66
this . _cacheStats = new CacheStats ( ) ;
67
67
68
68
this . ProviderName = this . _name ;
69
+ this . ProviderType = CachingProviderType . Redis ;
69
70
this . ProviderStats = this . _cacheStats ;
70
- this . ProviderType = _options . CachingProviderType ;
71
- this . ProviderOrder = _options . Order ;
72
71
this . ProviderMaxRdSecond = _options . MaxRdSecond ;
73
72
this . IsDistributedProvider = true ;
74
73
}
75
-
74
+
76
75
/// <summary>
77
76
/// Exists the specified cacheKey.
78
77
/// </summary>
@@ -498,42 +497,7 @@ public override int BaseGetCount(string prefix = "")
498
497
499
498
return this . SearchRedisKeys ( this . HandlePrefix ( prefix ) ) . Length ;
500
499
}
501
-
502
- /// <summary>
503
- /// Refresh the specified cacheKey, cacheValue and expiration.
504
- /// </summary>
505
- /// <param name="cacheKey">Cache key.</param>
506
- /// <param name="cacheValue">Cache value.</param>
507
- /// <param name="expiration">Expiration.</param>
508
- /// <typeparam name="T">The 1st type parameter.</typeparam>
509
- public override void BaseRefresh < T > ( string cacheKey , T cacheValue , TimeSpan expiration )
510
- {
511
- ArgumentCheck . NotNullOrWhiteSpace ( cacheKey , nameof ( cacheKey ) ) ;
512
- ArgumentCheck . NotNull ( cacheValue , nameof ( cacheValue ) ) ;
513
- ArgumentCheck . NotNegativeOrZero ( expiration , nameof ( expiration ) ) ;
514
-
515
- this . Remove ( cacheKey ) ;
516
- this . Set ( cacheKey , cacheValue , expiration ) ;
517
- }
518
-
519
- /// <summary>
520
- /// Refreshs the async.
521
- /// </summary>
522
- /// <returns>The async.</returns>
523
- /// <param name="cacheKey">Cache key.</param>
524
- /// <param name="cacheValue">Cache value.</param>
525
- /// <param name="expiration">Expiration.</param>
526
- /// <typeparam name="T">The 1st type parameter.</typeparam>
527
- public override async Task BaseRefreshAsync < T > ( string cacheKey , T cacheValue , TimeSpan expiration )
528
- {
529
- ArgumentCheck . NotNullOrWhiteSpace ( cacheKey , nameof ( cacheKey ) ) ;
530
- ArgumentCheck . NotNull ( cacheValue , nameof ( cacheValue ) ) ;
531
- ArgumentCheck . NotNegativeOrZero ( expiration , nameof ( expiration ) ) ;
532
-
533
- await this . RemoveAsync ( cacheKey ) ;
534
- await this . SetAsync ( cacheKey , cacheValue , expiration ) ;
535
- }
536
-
500
+
537
501
/// <summary>
538
502
/// Remove the specified cacheKey.
539
503
/// </summary>
0 commit comments