Register configuration in startup
This commit is contained in:
@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Authorization;
|
|||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Oqtane.Infrastructure;
|
using Oqtane.Infrastructure;
|
||||||
@ -96,9 +95,8 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static IServiceCollection AddOqtaneSingletonServices(this IServiceCollection services, IConfigurationRoot configurationRoot)
|
internal static IServiceCollection AddOqtaneSingletonServices(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddSingleton(configurationRoot);
|
|
||||||
services.AddSingleton<IInstallationManager, InstallationManager>();
|
services.AddSingleton<IInstallationManager, InstallationManager>();
|
||||||
services.AddSingleton<ISyncManager, SyncManager>();
|
services.AddSingleton<ISyncManager, SyncManager>();
|
||||||
services.AddSingleton<IDatabaseManager, DatabaseManager>();
|
services.AddSingleton<IDatabaseManager, DatabaseManager>();
|
||||||
|
@ -82,7 +82,8 @@ namespace Oqtane
|
|||||||
services.AddTransient<IUserClaimsPrincipalFactory<IdentityUser>, ClaimsPrincipalFactory<IdentityUser>>();
|
services.AddTransient<IUserClaimsPrincipalFactory<IdentityUser>, ClaimsPrincipalFactory<IdentityUser>>();
|
||||||
|
|
||||||
// register singleton scoped core services
|
// register singleton scoped core services
|
||||||
services.AddOqtaneSingletonServices(Configuration);
|
services.AddSingleton(Configuration)
|
||||||
|
.AddOqtaneSingletonServices();
|
||||||
|
|
||||||
// install any modules or themes ( this needs to occur BEFORE the assemblies are loaded into the app domain )
|
// install any modules or themes ( this needs to occur BEFORE the assemblies are loaded into the app domain )
|
||||||
InstallationManager.InstallPackages("Modules,Themes", _env.WebRootPath, _env.ContentRootPath);
|
InstallationManager.InstallPackages("Modules,Themes", _env.WebRootPath, _env.ContentRootPath);
|
||||||
|
Reference in New Issue
Block a user