diff --git a/EnvelopeGenerator.Application/DependencyInjection.cs b/EnvelopeGenerator.Application/DependencyInjection.cs
index 0d9116be..9e0042ef 100644
--- a/EnvelopeGenerator.Application/DependencyInjection.cs
+++ b/EnvelopeGenerator.Application/DependencyInjection.cs
@@ -24,9 +24,10 @@ public static class DependencyInjection
///
///
///
+ ///
///
[Obsolete("Use MediatR")]
- public static IServiceCollection AddEnvelopeGeneratorServices(this IServiceCollection services, IConfiguration config)
+ public static IServiceCollection AddEnvelopeGeneratorServices(this IServiceCollection services, IConfiguration config, bool usePdfBurner = false)
{
//Inject CRUD Service and repositoriesad
services.TryAddScoped();
@@ -50,25 +51,31 @@ public static class DependencyInjection
services.Configure(config.GetSection(nameof(MailParams)));
services.Configure(config.GetSection(nameof(AuthenticatorParams)));
services.Configure(config.GetSection(nameof(TotpSmsParams)));
- services.Configure(config.GetSection(nameof(PDFBurnerParams)));
- services.AddOptions()
- .Configure((GdPictureParams opt, IServiceProvider provider) =>
+
+ if (usePdfBurner)
{
- opt.License = config["GdPictureLicenseKey"]
- ?? provider.GetRequiredService().ReadThirdPartyModuleLicenseAsync("GDPICTURE").GetAwaiter().GetResult()
- ?? throw new InvalidOperationException($"License record not found for key: {"GDPICTURE"}");
- });
- services.AddSingleton(provider => {
- var license = provider.GetRequiredService>().Value.License;
- var licenseManager = new LicenseManager();
- licenseManager.RegisterKEY(license);
- return licenseManager;
- });
- services.AddTransient(provider => {
- // Ensure LicenseManager is resolved so that its constructor is called
- _ = provider.GetRequiredService();
- return new AnnotationManager();
- });
+ services.Configure(config.GetSection(nameof(PDFBurnerParams)));
+ services.AddOptions()
+ .Configure((GdPictureParams opt, IServiceProvider provider) =>
+ {
+ opt.License = config["GdPictureLicenseKey"]
+ ?? provider.GetRequiredService().ReadThirdPartyModuleLicenseAsync("GDPICTURE").GetAwaiter().GetResult()
+ ?? throw new InvalidOperationException($"License record not found for key: {"GDPICTURE"}");
+ });
+ services.AddSingleton(provider =>
+ {
+ var license = provider.GetRequiredService>().Value.License;
+ var licenseManager = new LicenseManager();
+ licenseManager.RegisterKEY(license);
+ return licenseManager;
+ });
+ services.AddTransient(provider =>
+ {
+ // Ensure LicenseManager is resolved so that its constructor is called
+ _ = provider.GetRequiredService();
+ return new AnnotationManager();
+ });
+ }
services.AddHttpClientService(config.GetSection(nameof(GtxMessagingParams)));
services.TryAddSingleton();