Construct ApplicationHost with DI framework instead of manually

This commit is contained in:
Mark Monteiro
2020-03-15 15:23:50 +01:00
parent 6a6293afc7
commit 6fbdf0d6a2
3 changed files with 19 additions and 21 deletions

View File

@@ -191,8 +191,9 @@ namespace Jellyfin.Server
var webHost = CreateWebHostBuilder(appHost, serviceCollection, startupConfig, appPaths).Build();
// A bit hacky to re-use service provider since ASP.NET doesn't allow a custom service collection.
// Re-use the web host service provider in the app host since ASP.NET doesn't allow a custom service collection.
appHost.ServiceProvider = webHost.Services;
appHost.InitializeServices();
appHost.FindParts();
Migrations.MigrationRunner.Run(appHost, _loggerFactory);