diff --git a/Toolkit.Foundation/ComponentBuilder.cs b/Toolkit.Foundation/ComponentBuilder.cs index dde604e..2f90b1a 100644 --- a/Toolkit.Foundation/ComponentBuilder.cs +++ b/Toolkit.Foundation/ComponentBuilder.cs @@ -76,14 +76,8 @@ public class ComponentBuilder : configurationRegistered = true; - hostBuilder.ConfigureServices(services => - { - services.AddConfiguration(section: section, - defaultConfiguration: configuration); - - services.AddConfiguration(section: section, - defaultConfiguration: configuration); - }); + hostBuilder.AddConfiguration(section: section, + defaultConfiguration: configuration); return this; } diff --git a/Toolkit.Foundation/IHostBuilderExtension.cs b/Toolkit.Foundation/IHostBuilderExtension.cs index 944977b..de95c71 100644 --- a/Toolkit.Foundation/IHostBuilderExtension.cs +++ b/Toolkit.Foundation/IHostBuilderExtension.cs @@ -133,7 +133,8 @@ public static class IHostBuilderExtension services.AddTransient, ConfigurationInitializer>(provider => provider.GetRequiredService().Create>(section)); - services.AddTransient, WritableConfiguration>(); + services.TryAddKeyedTransient>(section, (provider, key) => + new WritableConfiguration(provider.GetRequiredKeyedService>(key))); services.TryAddKeyedTransient>(section, (provider, key) => new ConfigurationDescriptor(section, provider.GetRequiredKeyedService>(key))); diff --git a/Toolkit.Foundation/IPipelineBehavior.cs b/Toolkit.Foundation/IPipelineBehaviour.cs similarity index 100% rename from Toolkit.Foundation/IPipelineBehavior.cs rename to Toolkit.Foundation/IPipelineBehaviour.cs