inject LicenseManager
This commit is contained in:
parent
1341f69ab1
commit
a611df4914
@ -7,8 +7,10 @@ using MediatR;
|
|||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
using QRCoder;
|
using QRCoder;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using GdPicture14;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application;
|
namespace EnvelopeGenerator.Application;
|
||||||
|
|
||||||
@ -59,6 +61,12 @@ public static class DependencyInjection
|
|||||||
?? mediator.ReadThirdPartyModuleLicenseAsync(licenseKey).GetAwaiter().GetResult()
|
?? mediator.ReadThirdPartyModuleLicenseAsync(licenseKey).GetAwaiter().GetResult()
|
||||||
?? throw new InvalidOperationException($"License record not found for key: {licenseKey}");
|
?? throw new InvalidOperationException($"License record not found for key: {licenseKey}");
|
||||||
});
|
});
|
||||||
|
services.AddSingleton(provider => {
|
||||||
|
var license = provider.GetRequiredService<IOptions<GdPictureParams>>().Value.License;
|
||||||
|
var licenseManager = new LicenseManager();
|
||||||
|
licenseManager.RegisterKEY(license);
|
||||||
|
return licenseManager;
|
||||||
|
});
|
||||||
|
|
||||||
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
|
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
|
||||||
services.TryAddSingleton<ISmsSender, GTXSmsSender>();
|
services.TryAddSingleton<ISmsSender, GTXSmsSender>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user