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:
2026-11-02 15:23:21 +01:00
parent 8ff8a9e58b
commit 82be3c5a4f
8 changed files with 54 additions and 51 deletions

View File

@@ -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()

View File

@@ -0,0 +1,10 @@
#if NET
namespace DigitalData.MessagingService.Client.DependencyInjection;
/// <summary>
///
/// </summary>
public static class DependencyInjectionExtensions
{
}
#endif

View File

@@ -0,0 +1,10 @@
#if NET
namespace DigitalData.MessagingService.Client.DependencyInjection;
/// <summary>
///
/// </summary>
public class MessagingServiceConfiguration
{
}
#endif

View File

@@ -61,7 +61,7 @@
<Target Name="EmbedProjectReferences" DependsOnTargets="ResolveReferences">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget','ProjectReference'))" />
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget','ProjectReference'))" />
</ItemGroup>
</Target>