diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs index faaf450ddc..597c3e74ce 100644 --- a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs @@ -7,10 +7,11 @@ using Volo.Abp.Json.SystemTextJson; namespace Volo.Abp.Dapr; -public class AbpDaprClientFactory : ITransientDependency +public class AbpDaprClientFactory : ITransientDependency, IAbpDaprClientFactory { protected AbpDaprOptions Options { get; } protected AbpSystemTextJsonSerializerOptions SystemTextJsonSerializerOptions { get; } + private readonly static ConcurrentDictionary JsonSerializerOptionsCache = new(); public AbpDaprClientFactory( IOptions options, @@ -38,11 +39,9 @@ public class AbpDaprClientFactory : ITransientDependency return builder.Build(); } - private readonly static ConcurrentDictionary JsonSerializerOptionsCache = new ConcurrentDictionary(); - protected virtual Task CreateJsonSerializerOptions() { return Task.FromResult(JsonSerializerOptionsCache.GetOrAdd(nameof(AbpDaprClientFactory), _ => new JsonSerializerOptions(SystemTextJsonSerializerOptions.JsonSerializerOptions))); } -} +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs new file mode 100644 index 0000000000..12dc15bb67 --- /dev/null +++ b/framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs @@ -0,0 +1,8 @@ +using Dapr.Client; + +namespace Volo.Abp.Dapr; + +public interface IAbpDaprClientFactory +{ + Task CreateAsync(); +} \ No newline at end of file