diff --git a/build/releasenotes.props b/build/releasenotes.props
index 5cba50e4..1fe50f01 100644
--- a/build/releasenotes.props
+++ b/build/releasenotes.props
@@ -1,13 +1,13 @@
+ 1. Support IServiceProvider in setupActions
1. Upgrading dependencies.
- 1. Fixed redis distributed lock for different process.
- 2. Support code configuration for StackExchange.Redis.
+ 1. Upgrading dependencies.
1. Upgrading dependencies.
@@ -40,25 +40,22 @@
1. Upgrading dependencies.
- 1. Support async version of subscribe.
+ 1. Upgrading dependencies.
- 1. Support code configuration for StackExchange.Redis.
- 2. Support async version of subscribe.
+ 1. Upgrading dependencies.
- 1. Support async version of subscribe.
+ 1. Upgrading dependencies.
- 1. Support async version of subscribe.
+ 1. Upgrading dependencies.
- 1. Support async version of subscribe.
- 2. Rename WithConfluentKafkaBus to WithZookeeeperBus.
+ 1. Upgrading dependencies.
- 1. Support custom serializer.
- 2. Fixed DiskCachingProvider async warning.
+ 1. Upgrading dependencies.
1. Upgrading dependencies.
diff --git a/build/version.props b/build/version.props
index 8cadff5e..5dc47ec6 100644
--- a/build/version.props
+++ b/build/version.props
@@ -1,28 +1,28 @@
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
- 1.9.0
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
+ 1.9.1
diff --git a/bus/EasyCaching.Bus.Redis/Configurations/EasyCachingOptionsExtensions.cs b/bus/EasyCaching.Bus.Redis/Configurations/EasyCachingOptionsExtensions.cs
index 46f35f99..99b753e9 100644
--- a/bus/EasyCaching.Bus.Redis/Configurations/EasyCachingOptionsExtensions.cs
+++ b/bus/EasyCaching.Bus.Redis/Configurations/EasyCachingOptionsExtensions.cs
@@ -58,6 +58,7 @@ void configure(RedisBusOptions x)
x.Username = redisOptions.Username;
x.Password = redisOptions.Password;
x.SslHost = redisOptions.SslHost;
+ x.SerializerName = redisOptions.SerializerName;
foreach (var item in redisOptions.Endpoints) x.Endpoints.Add(item);
}
diff --git a/docs/In-Memory.md b/docs/In-Memory.md
index 76e44463..9174afba 100644
--- a/docs/In-Memory.md
+++ b/docs/In-Memory.md
@@ -46,7 +46,7 @@ public class Startup
// below two settings are added in v0.8.0
// enable deep clone when reading object from cache or not, default value is true.
EnableReadDeepClone = true,
- // enable deep clone when writing object to cache or not, default valuee is false.
+ // enable deep clone when writing object to cache or not, default value is false.
EnableWriteDeepClone = false,
};
// the max random second will be added to cache's expiration, default value is 120
diff --git a/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj b/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj
index 9170f032..5cd7f675 100644
--- a/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj
+++ b/interceptor/EasyCaching.Interceptor.AspectCore/EasyCaching.Interceptor.AspectCore.csproj
@@ -35,7 +35,7 @@
-
-
+
+
diff --git a/src/EasyCaching.Core/Configurations/EasyCachingServiceCollectionExtensions.cs b/src/EasyCaching.Core/Configurations/EasyCachingServiceCollectionExtensions.cs
index a3f105bc..2873dad9 100644
--- a/src/EasyCaching.Core/Configurations/EasyCachingServiceCollectionExtensions.cs
+++ b/src/EasyCaching.Core/Configurations/EasyCachingServiceCollectionExtensions.cs
@@ -1,8 +1,8 @@
namespace Microsoft.Extensions.DependencyInjection
{
using EasyCaching.Core;
- using EasyCaching.Core.Configurations;
- using System;
+ using EasyCaching.Core.Configurations;
+ using System;
///
/// EasyCaching service collection extensions.
@@ -10,7 +10,7 @@
public static class EasyCachingServiceCollectionExtensions
{
///
- /// Adds the easycaching.
+ /// Adds the EasyCaching.
///
/// The easy caching.
/// Services.
@@ -30,5 +30,38 @@ public static IServiceCollection AddEasyCaching(this IServiceCollection services
return services;
}
+
+ ///
+ /// Adds the EasyCaching.
+ ///
+ /// The easy caching.
+ /// Services.
+ /// Setup action.
+ public static IServiceCollection AddEasyCaching(this IServiceCollection services, Action setupAction)
+ {
+ ArgumentCheck.NotNull(setupAction, nameof(setupAction));
+
+ // Options
+ services.AddSingleton(sp =>
+ {
+ var options = new EasyCachingOptions();
+ setupAction(sp, options);
+ return options;
+ });
+
+ // Extension services
+ services.AddSingleton(sp =>
+ {
+ var options = sp.GetRequiredService();
+ foreach (var serviceExtension in options.Extensions)
+ {
+ serviceExtension.AddServices(services);
+ }
+
+ return options;
+ });
+
+ return services;
+ }
}
}
diff --git a/src/EasyCaching.InMemory/DefaultInMemoryCachingProvider.Async.cs b/src/EasyCaching.InMemory/DefaultInMemoryCachingProvider.Async.cs
index 3c2d696d..96b7050e 100644
--- a/src/EasyCaching.InMemory/DefaultInMemoryCachingProvider.Async.cs
+++ b/src/EasyCaching.InMemory/DefaultInMemoryCachingProvider.Async.cs
@@ -159,11 +159,12 @@ public override async Task