Refactor configuration handling
Refactored `MessagingServiceApplicationConfiguration` to simplify the tracking of the LuckyPennySoft license key configuration by replacing the `_configured` tuple with a boolean. Removed email account configuration methods from this class. Updated `MessagingServiceInfrastructureConfiguration` to introduce a new `_configured` tuple for tracking `RabbitMqConnectionFactory` and `EmailAccounts` configurations. Added methods for configuring email accounts and updated the `EnsureRabbitMqConnectionFactoryAdded` method to include email account checks. Changed the namespace of `EmailAccountsOptions.cs` to `DigitalData.MessagingService.Infrastructure.Options`. Modified `Program.cs` to include email account configuration in the infrastructure setup. Added new files `DependencyInjectionExtensions.cs` and `MessagingServiceConfiguration.cs` as placeholders for future extensions, wrapped in `#if NET` directives. Removed an `<ItemGroup>` from `DigitalData.MessagingService.Infrastructure.csproj` and updated `DigitalData.MessagingService.Client.csproj` for XML compliance.
This commit is contained in:
@@ -68,7 +68,9 @@ try
|
||||
builder.Services.AddMessagingServiceApplication(builder.Configuration);
|
||||
|
||||
// Register Infrastructure layer (RabbitMQ, Repositories, etc.)
|
||||
builder.Services.AddInfrastructure(cfg => cfg.AddRabbitMqConnectionFactory(builder.Configuration));
|
||||
builder.Services.AddInfrastructure(cfg => cfg
|
||||
.AddRabbitMqConnectionFactory(builder.Configuration)
|
||||
.ConfigureEmailAccounts(builder.Configuration));
|
||||
|
||||
// Health checks — each check corresponds to a singleton registered in the Infrastructure layer
|
||||
builder.Services.AddHealthChecks()
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#if NET
|
||||
namespace DigitalData.MessagingService.Client.DependencyInjection;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class DependencyInjectionExtensions
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#if NET
|
||||
namespace DigitalData.MessagingService.Client.DependencyInjection;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class MessagingServiceConfiguration
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
<Target Name="EmbedProjectReferences" DependsOnTargets="ResolveReferences">
|
||||
<ItemGroup>
|
||||
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget','ProjectReference'))" />
|
||||
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget','ProjectReference'))" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user