refactor(application)!: accept license key directly in AddMessagingServiceApplication
Remove MessagingServiceApplicationConfiguration and pass the LuckyPennySoft license key as a string. Program.cs now reads the value from configuration and fails fast with a clear error when it is missing. BREAKING CHANGE: AddMessagingServiceApplication now takes a license key string.
This commit is contained in:
@@ -65,7 +65,9 @@ try
|
||||
builder.Configuration.AddJsonFile("appsettings.Secrets.json", optional: true, reloadOnChange: true);
|
||||
|
||||
// Register Application layer (MediatR, AutoMapper, FluentValidation)
|
||||
builder.Services.AddMessagingServiceApplication(cfg => cfg.SetLuckyPennySoftLicenseKey(builder.Configuration));
|
||||
var LuckyPennySoftLicenseKey = builder.Configuration.GetValue<string>("LuckyPennySoftLicenseKey")
|
||||
?? throw new InvalidOperationException("The required configuration value 'LuckyPennySoftLicenseKey' is missing. Please ensure it is properly configured.");
|
||||
builder.Services.AddMessagingServiceApplication(LuckyPennySoftLicenseKey);
|
||||
|
||||
// Register Infrastructure layer (RabbitMQ, Repositories, etc.)
|
||||
builder.Services.AddInfrastructure(cfg => cfg
|
||||
|
||||
Reference in New Issue
Block a user