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:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user