From 4ff2f40653b7d4d27717ff0a490e683bb79aa2e1 Mon Sep 17 00:00:00 2001 From: Amir Hossein Shekari Date: Tue, 22 Aug 2023 03:38:43 +0330 Subject: [PATCH 1/3] Fix typo (#486) --- docs/In-Memory.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 790b8022cf01347695c5650b0e1423762383eae0 Mon Sep 17 00:00:00 2001 From: Moien Tajik Date: Fri, 8 Sep 2023 02:14:29 +0200 Subject: [PATCH 2/3] FEAT: add 2nd overload for AddEasyCaching() to support IServiceProvider in setupActions (#487) --- .../EasyCachingServiceCollectionExtensions.cs | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) 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; + } } } From c74ad32f48a63714719f46e76b7a6b1847e61f87 Mon Sep 17 00:00:00 2001 From: catcherwong Date: Fri, 8 Sep 2023 00:36:16 +0000 Subject: [PATCH 3/3] docs: update version to 1.9.1 Signed-off-by: catcherwong --- build/releasenotes.props | 20 +++++++---------- build/version.props | 46 ++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/build/releasenotes.props b/build/releasenotes.props index 9c2204f1..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,26 +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. - 3. fix: Using IConfiguration for WithRedisBus configuration cause DefaultRedisBus throw "Sequence contains no matching element" exception + 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 393996a2..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.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.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