From a914ce8153d19b7c907a4e8fd822db02197d41f4 Mon Sep 17 00:00:00 2001 From: Young Date: Sat, 26 Oct 2024 10:51:54 +0800 Subject: [PATCH] fixed namespace --- src/Infrastructure.EventBus/IEventBus.cs | 2 +- src/Infrastructure.EventBus/IIntegrationEventHandler.cs | 2 +- src/Infrastructure.EventBus/IntegrationEvent.cs | 2 +- .../RabbitMQ/IPersistentConnection.cs | 2 +- src/Infrastructure.EventBus/RabbitMQ/RabbitMQEventBus.cs | 8 ++++---- .../RabbitMQ/RabbitMQPersistentConnection.cs | 2 +- .../RabbitMQ/RabbitMqConnectionOptions.cs | 2 +- .../ServiceCollectionExtensions.cs | 8 ++++---- .../Subscriptions/IEventBusSubscriptionManager.cs | 2 +- .../Subscriptions/InMemoryEventBusSubscriptionManager.cs | 2 +- src/Infrastructure.EventBus/Subscriptions/Subscription.cs | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Infrastructure.EventBus/IEventBus.cs b/src/Infrastructure.EventBus/IEventBus.cs index 7a01322..a1c1499 100644 --- a/src/Infrastructure.EventBus/IEventBus.cs +++ b/src/Infrastructure.EventBus/IEventBus.cs @@ -1,4 +1,4 @@ -namespace Roller.Infrastructure.EventBus; +namespace Infrastructure.EventBus; public interface IEventBus { diff --git a/src/Infrastructure.EventBus/IIntegrationEventHandler.cs b/src/Infrastructure.EventBus/IIntegrationEventHandler.cs index de05426..5bef033 100644 --- a/src/Infrastructure.EventBus/IIntegrationEventHandler.cs +++ b/src/Infrastructure.EventBus/IIntegrationEventHandler.cs @@ -1,4 +1,4 @@ -namespace Roller.Infrastructure.EventBus; +namespace Infrastructure.EventBus; public interface IIntegrationEventHandler where TIntegrationEvent : IntegrationEvent diff --git a/src/Infrastructure.EventBus/IntegrationEvent.cs b/src/Infrastructure.EventBus/IntegrationEvent.cs index 3fa3a49..6bcaf13 100644 --- a/src/Infrastructure.EventBus/IntegrationEvent.cs +++ b/src/Infrastructure.EventBus/IntegrationEvent.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace Roller.Infrastructure.EventBus; +namespace Infrastructure.EventBus; [method: JsonConstructor] public class IntegrationEvent(Guid id, DateTime createdDate) diff --git a/src/Infrastructure.EventBus/RabbitMQ/IPersistentConnection.cs b/src/Infrastructure.EventBus/RabbitMQ/IPersistentConnection.cs index 9a7b17a..98099a5 100644 --- a/src/Infrastructure.EventBus/RabbitMQ/IPersistentConnection.cs +++ b/src/Infrastructure.EventBus/RabbitMQ/IPersistentConnection.cs @@ -1,4 +1,4 @@ -namespace Roller.Infrastructure.EventBus.RabbitMQ; +namespace Infrastructure.EventBus.RabbitMQ; public interface IPersistentConnection { diff --git a/src/Infrastructure.EventBus/RabbitMQ/RabbitMQEventBus.cs b/src/Infrastructure.EventBus/RabbitMQ/RabbitMQEventBus.cs index be33b85..b5c7c68 100644 --- a/src/Infrastructure.EventBus/RabbitMQ/RabbitMQEventBus.cs +++ b/src/Infrastructure.EventBus/RabbitMQ/RabbitMQEventBus.cs @@ -1,12 +1,12 @@ using System.Net.Sockets; using System.Text; using System.Text.Json; +using Infrastructure.EventBus.Subscriptions; using Polly; using RabbitMQ.Client.Events; using RabbitMQ.Client.Exceptions; -using Roller.Infrastructure.EventBus.Subscriptions; -namespace Roller.Infrastructure.EventBus.RabbitMQ; +namespace Infrastructure.EventBus.RabbitMQ; public class RabbitMQEventBus : IEventBus { @@ -255,8 +255,8 @@ public class RabbitMQEventBus : IEventBus var @event = JsonSerializer.Deserialize(message, eventType); var eventHandlerType = typeof(IIntegrationEventHandler<>).MakeGenericType(eventType); await Task.Yield(); - await (Task)eventHandlerType.GetMethod(nameof(IIntegrationEventHandler.HandleAsync)) - .Invoke(handler, [@event]); + await ((Task)eventHandlerType.GetMethod(nameof(IIntegrationEventHandler.HandleAsync)) + .Invoke(handler, [@event]))!; } _logger.LogTrace("Processed event {EventName}.", eventName); diff --git a/src/Infrastructure.EventBus/RabbitMQ/RabbitMQPersistentConnection.cs b/src/Infrastructure.EventBus/RabbitMQ/RabbitMQPersistentConnection.cs index 10fe3b1..54d1e50 100644 --- a/src/Infrastructure.EventBus/RabbitMQ/RabbitMQPersistentConnection.cs +++ b/src/Infrastructure.EventBus/RabbitMQ/RabbitMQPersistentConnection.cs @@ -4,7 +4,7 @@ using Polly; using RabbitMQ.Client.Events; using RabbitMQ.Client.Exceptions; -namespace Roller.Infrastructure.EventBus.RabbitMQ; +namespace Infrastructure.EventBus.RabbitMQ; public class RabbitMQPersistentConnection( IConnectionFactory connectionFactory, diff --git a/src/Infrastructure.EventBus/RabbitMQ/RabbitMqConnectionOptions.cs b/src/Infrastructure.EventBus/RabbitMQ/RabbitMqConnectionOptions.cs index a25be7a..d0b22a5 100644 --- a/src/Infrastructure.EventBus/RabbitMQ/RabbitMqConnectionOptions.cs +++ b/src/Infrastructure.EventBus/RabbitMQ/RabbitMqConnectionOptions.cs @@ -1,4 +1,4 @@ -namespace Roller.Infrastructure.EventBus.RabbitMQ; +namespace Infrastructure.EventBus.RabbitMQ; public class RabbitMqConnectionOptions { diff --git a/src/Infrastructure.EventBus/ServiceCollectionExtensions.cs b/src/Infrastructure.EventBus/ServiceCollectionExtensions.cs index 50d390e..6fe12ee 100644 --- a/src/Infrastructure.EventBus/ServiceCollectionExtensions.cs +++ b/src/Infrastructure.EventBus/ServiceCollectionExtensions.cs @@ -1,9 +1,9 @@ -using Microsoft.Extensions.Configuration; +using Infrastructure.EventBus.RabbitMQ; +using Infrastructure.EventBus.Subscriptions; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Roller.Infrastructure.EventBus.RabbitMQ; -using Roller.Infrastructure.EventBus.Subscriptions; -namespace Roller.Infrastructure.EventBus; +namespace Infrastructure.EventBus; public static class ServiceCollectionExtensions { diff --git a/src/Infrastructure.EventBus/Subscriptions/IEventBusSubscriptionManager.cs b/src/Infrastructure.EventBus/Subscriptions/IEventBusSubscriptionManager.cs index e11e67f..a28d186 100644 --- a/src/Infrastructure.EventBus/Subscriptions/IEventBusSubscriptionManager.cs +++ b/src/Infrastructure.EventBus/Subscriptions/IEventBusSubscriptionManager.cs @@ -1,4 +1,4 @@ -namespace Roller.Infrastructure.EventBus.Subscriptions; +namespace Infrastructure.EventBus.Subscriptions; public interface IEventBusSubscriptionManager { diff --git a/src/Infrastructure.EventBus/Subscriptions/InMemoryEventBusSubscriptionManager.cs b/src/Infrastructure.EventBus/Subscriptions/InMemoryEventBusSubscriptionManager.cs index 90d2a04..d256f23 100644 --- a/src/Infrastructure.EventBus/Subscriptions/InMemoryEventBusSubscriptionManager.cs +++ b/src/Infrastructure.EventBus/Subscriptions/InMemoryEventBusSubscriptionManager.cs @@ -1,4 +1,4 @@ -namespace Roller.Infrastructure.EventBus.Subscriptions; +namespace Infrastructure.EventBus.Subscriptions; public class InMemoryEventBusSubscriptionManager : IEventBusSubscriptionManager { diff --git a/src/Infrastructure.EventBus/Subscriptions/Subscription.cs b/src/Infrastructure.EventBus/Subscriptions/Subscription.cs index a46da21..4d17a0e 100644 --- a/src/Infrastructure.EventBus/Subscriptions/Subscription.cs +++ b/src/Infrastructure.EventBus/Subscriptions/Subscription.cs @@ -1,4 +1,4 @@ -namespace Roller.Infrastructure.EventBus.Subscriptions; +namespace Infrastructure.EventBus.Subscriptions; public class Subscription {