IServerStartup implementation

This commit is contained in:
Pavel Vesely
2020-05-11 11:05:17 +02:00
parent 552df0c9fc
commit 7c814a67b3
7 changed files with 91 additions and 9 deletions

View File

@ -53,11 +53,17 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddSingleton(hostedServiceType, serviceType);
}
}
var startUps = assembly.GetInstances<IServerStartup>();
foreach (var startup in startUps)
{
startup.ConfigureServices(services);
}
}
return services;
}
private static void LoadAssemblies()
{
var assemblyPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);