move gdpucture parmas configuration to application layer
This commit is contained in:
@@ -96,17 +96,6 @@ try
|
||||
);
|
||||
#endregion Add DB Context, EG Inf. and Services
|
||||
|
||||
builder.Services.AddOptions<GdPictureOptions>()
|
||||
.Configure((GdPictureOptions opt, IServiceProvider sp) =>
|
||||
{
|
||||
var licenseKey = "GDPICTURE";
|
||||
using var scope = sp.CreateScope();
|
||||
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
|
||||
opt.License = config["GdPictureLicenseKey"]
|
||||
?? mediator.ReadThirdPartyModuleLicenseAsync(licenseKey).GetAwaiter().GetResult()
|
||||
?? throw new InvalidOperationException($"License record not found for key: {licenseKey}");
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
#region Web API Middleware
|
||||
|
||||
Reference in New Issue
Block a user