From c0e0fa3ba10b1f16f9bf7ca977ae12346ff33564 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 5 Nov 2026 09:45:03 +0100 Subject: [PATCH] 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. --- .../DependencyInjection/DependencyInjection.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/DigitalData.MessagingService.Application/DependencyInjection/DependencyInjection.cs b/src/core/DigitalData.MessagingService.Application/DependencyInjection/DependencyInjection.cs index 74af05c..a064907 100644 --- a/src/core/DigitalData.MessagingService.Application/DependencyInjection/DependencyInjection.cs +++ b/src/core/DigitalData.MessagingService.Application/DependencyInjection/DependencyInjection.cs @@ -10,7 +10,7 @@ namespace DigitalData.MessagingService.Application.DependencyInjection; /// 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); });