diff --git a/src/HostApplication/PluginStartup.cs b/src/HostApplication/PluginStartup.cs index f318ff54..5a7ed95b 100644 --- a/src/HostApplication/PluginStartup.cs +++ b/src/HostApplication/PluginStartup.cs @@ -2,10 +2,7 @@ public static class PluginStartup { - /// - /// Configures the plugins. - /// - public static void Configure(WebApplicationBuilder builder) + public static void ConfigureServices(WebApplicationBuilder builder) { var envConfiguration = new CPluginEnvConfiguration(); PluginLoader.Load(envConfiguration); @@ -13,15 +10,11 @@ public static void Configure(WebApplicationBuilder builder) foreach (var dependencyServicesRegisterer in dependencyServicesRegisterers) dependencyServicesRegisterer.RegisterServices(builder.Services, builder.Configuration); - var entityTypeConfigurators = TypeFinder - .FindSubtypesOf() - .ToList(); - builder .Services - .AddSingleton>(entityTypeConfigurators); + .AddSubtypesOf(ServiceLifetime.Transient); - // These services are only added when no plug-in registers its own implementation. + // These services are only added when no plugin registers its own implementation. builder.Services.TryAddSingleton(); builder.Services.TryAddSingleton(); }