feat(application): make license key optional

Consumers that use the HTTP client do not pass AutoMapper license data, so the key is now optional and only assigned when supplied. Existing callers keep working unchanged.
This commit is contained in:
2026-11-05 09:45:03 +01:00
parent 4a39e3f92b
commit c0e0fa3ba1

View File

@@ -10,7 +10,7 @@ namespace DigitalData.MessagingService.Application.DependencyInjection;
/// </summary>
public static class DependencyInjection
{
public static IServiceCollection AddMessagingServiceApplication(this IServiceCollection services, string luckyPennySoftLicenseKey)
public static IServiceCollection AddMessagingServiceApplication(this IServiceCollection services, string? luckyPennySoftLicenseKey = null)
{
var assembly = Assembly.GetExecutingAssembly();
@@ -24,7 +24,8 @@ public static class DependencyInjection
// AutoMapper - Use built-in DI extension (AutoMapper 16.2.0+)
services.AddAutoMapper(config =>
{
config.LicenseKey = luckyPennySoftLicenseKey;
if (luckyPennySoftLicenseKey is not null)
config.LicenseKey = luckyPennySoftLicenseKey;
config.AddMaps(assembly);
});