From 8b58991ff3204873567b322b39d8dc8a5b2dc70d Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 15 Oct 2019 14:37:28 +0300 Subject: [PATCH] DistributedEventBusOptions to AbpDistributedEventBusOptions --- .../Entities/Events/Distributed/EntityToEtoMapper.cs | 4 ++-- .../Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs | 8 ++++---- .../Volo/Abp/EventBus/AbpEventBusModule.cs | 2 +- ...ventBusOptions.cs => AbpDistributedEventBusOptions.cs} | 4 ++-- .../Abp/EventBus/Distributed/LocalDistributedEventBus.cs | 6 +++--- .../Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs | 2 +- .../Volo/Abp/Identity/AbpIdentityDomainModule.cs | 2 +- .../Abp/Identity/Distributed_User_Change_Event_Tests.cs | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) rename framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/{DistributedEventBusOptions.cs => AbpDistributedEventBusOptions.cs} (77%) diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityToEtoMapper.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityToEtoMapper.cs index b15ea3d6a4..24a757fb08 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityToEtoMapper.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityToEtoMapper.cs @@ -11,10 +11,10 @@ namespace Volo.Abp.Domain.Entities.Events.Distributed public class EntityToEtoMapper : IEntityToEtoMapper, ITransientDependency { protected IHybridServiceScopeFactory HybridServiceScopeFactory { get; } - protected DistributedEventBusOptions Options { get; } + protected AbpDistributedEventBusOptions Options { get; } public EntityToEtoMapper( - IOptions options, + IOptions options, IHybridServiceScopeFactory hybridServiceScopeFactory) { HybridServiceScopeFactory = hybridServiceScopeFactory; diff --git a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs index 04e72af0d0..c530437e6f 100644 --- a/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs @@ -23,7 +23,7 @@ namespace Volo.Abp.EventBus.RabbitMq public class RabbitMqDistributedEventBus : EventBusBase, IDistributedEventBus, ISingletonDependency { protected AbpRabbitMqEventBusOptions AbpRabbitMqEventBusOptions { get; } - protected DistributedEventBusOptions DistributedEventBusOptions { get; } + protected AbpDistributedEventBusOptions AbpDistributedEventBusOptions { get; } protected IConnectionPool ConnectionPool { get; } protected IRabbitMqSerializer Serializer { get; } @@ -38,14 +38,14 @@ namespace Volo.Abp.EventBus.RabbitMq IConnectionPool connectionPool, IRabbitMqSerializer serializer, IServiceScopeFactory serviceScopeFactory, - IOptions distributedEventBusOptions, + IOptions distributedEventBusOptions, IRabbitMqMessageConsumerFactory messageConsumerFactory) : base(serviceScopeFactory) { ConnectionPool = connectionPool; Serializer = serializer; MessageConsumerFactory = messageConsumerFactory; - DistributedEventBusOptions = distributedEventBusOptions.Value; + AbpDistributedEventBusOptions = distributedEventBusOptions.Value; AbpRabbitMqEventBusOptions = options.Value; HandlerFactories = new ConcurrentDictionary>(); @@ -71,7 +71,7 @@ namespace Volo.Abp.EventBus.RabbitMq Consumer.OnMessageReceived(ProcessEventAsync); - SubscribeHandlers(DistributedEventBusOptions.Handlers); + SubscribeHandlers(AbpDistributedEventBusOptions.Handlers); } private async Task ProcessEventAsync(IModel channel, BasicDeliverEventArgs ea) diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs index 3729b48b61..15f8bd8a3e 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/AbpEventBusModule.cs @@ -37,7 +37,7 @@ namespace Volo.Abp.EventBus options.Handlers.AddIfNotContains(localHandlers); }); - services.Configure(options => + services.Configure(options => { options.Handlers.AddIfNotContains(distributedHandlers); }); diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusOptions.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpDistributedEventBusOptions.cs similarity index 77% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusOptions.cs rename to framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpDistributedEventBusOptions.cs index 045efe9d02..1d1d7768f2 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/DistributedEventBusOptions.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/AbpDistributedEventBusOptions.cs @@ -2,12 +2,12 @@ using Volo.Abp.Collections; namespace Volo.Abp.EventBus.Distributed { - public class DistributedEventBusOptions + public class AbpDistributedEventBusOptions { public ITypeList Handlers { get; } public EtoMappingDictionary EtoMappings { get; set; } - public DistributedEventBusOptions() + public AbpDistributedEventBusOptions() { Handlers = new TypeList(); EtoMappings = new EtoMappingDictionary(); diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs index a50cdc2d70..0d0ea6b107 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs @@ -17,16 +17,16 @@ namespace Volo.Abp.EventBus.Distributed protected IServiceScopeFactory ServiceScopeFactory { get; } - protected DistributedEventBusOptions DistributedEventBusOptions { get; } + protected AbpDistributedEventBusOptions AbpDistributedEventBusOptions { get; } public LocalDistributedEventBus( ILocalEventBus localEventBus, IServiceScopeFactory serviceScopeFactory, - IOptions distributedEventBusOptions) + IOptions distributedEventBusOptions) { _localEventBus = localEventBus; ServiceScopeFactory = serviceScopeFactory; - DistributedEventBusOptions = distributedEventBusOptions.Value; + AbpDistributedEventBusOptions = distributedEventBusOptions.Value; Subscribe(distributedEventBusOptions.Value.Handlers); } diff --git a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs index aea5013fef..b9aef1ca2e 100644 --- a/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs +++ b/framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/TestAppModule.cs @@ -44,7 +44,7 @@ namespace Volo.Abp.TestApp private void ConfigureDistributedEventBus() { - Configure(options => + Configure(options => { options.EtoMappings.Add(); }); diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs index 938b4050d7..1bb065017e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs @@ -18,7 +18,7 @@ namespace Volo.Abp.Identity { public override void ConfigureServices(ServiceConfigurationContext context) { - Configure(options => + Configure(options => { options.EtoMappings.Add(); }); diff --git a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/Distributed_User_Change_Event_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/Distributed_User_Change_Event_Tests.cs index bc6a8cd27b..95e8f925c4 100644 --- a/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/Distributed_User_Change_Event_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/Distributed_User_Change_Event_Tests.cs @@ -30,7 +30,7 @@ namespace Volo.Abp.Identity [Fact] public async Task Should_Register_Handler() { - var options = GetRequiredService>().Value; + var options = GetRequiredService>().Value; options.EtoMappings.ShouldContain(m => m.Key == typeof(IdentityUser) && m.Value.EtoType == typeof(UserEto)); options.Handlers.ShouldContain(h => h == typeof(DistributedUserUpdateHandler)); }