fixed startup
This commit is contained in:
@@ -41,11 +41,12 @@ namespace Hyperbar.Windows
|
|||||||
isolatedServices.AddTransient<ITemplateGeneratorFactory, TemplateGeneratorFactory>();
|
isolatedServices.AddTransient<ITemplateGeneratorFactory, TemplateGeneratorFactory>();
|
||||||
|
|
||||||
builder.Create(context, isolatedServices);
|
builder.Create(context, isolatedServices);
|
||||||
|
|
||||||
}).Build();
|
}).Build();
|
||||||
|
|
||||||
services.AddTransient<IWidgetContext>(provider => new WidgetContext(host.Services));
|
services.AddTransient<IWidgetContext>(provider => new WidgetContext(host.Services));
|
||||||
services.AddTransient(provider => host);
|
|
||||||
|
|
||||||
|
host.Start();
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,9 +106,7 @@ public static class IServiceCollectionExtensions
|
|||||||
{
|
{
|
||||||
services.Configure<TConfiguration>(configuration);
|
services.Configure<TConfiguration>(configuration);
|
||||||
services.AddSingleton<IConfigureOptions<TConfiguration>>(new ConfigureNamedOptions<TConfiguration>("", args => { }));
|
services.AddSingleton<IConfigureOptions<TConfiguration>>(new ConfigureNamedOptions<TConfiguration>("", args => { }));
|
||||||
services.AddTransient(provider => {
|
services.AddTransient(provider => provider.GetService<IOptionsMonitor<TConfiguration>>()!.CurrentValue);
|
||||||
|
|
||||||
return provider.GetService<IOptionsMonitor<TConfiguration>>()!.CurrentValue; });
|
|
||||||
|
|
||||||
services.AddSingleton<IConfigurationWriter<TConfiguration>>(provider =>
|
services.AddSingleton<IConfigurationWriter<TConfiguration>>(provider =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user