RE 10
This commit is contained in:
@@ -8,13 +8,14 @@ internal static class ServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddZeroConfiguration(this IServiceCollection services, IConfiguration config)
|
||||
{
|
||||
services.AddOptions<ZeroOptions>().Bind(config.GetSection("Zero")).Configure(opts =>
|
||||
services.AddOptions<ZeroOptions>().Configure<IServiceProvider>((opts, svc) =>
|
||||
{
|
||||
opts.ServiceProvider = svc;
|
||||
opts.Version = "0.0.1-alpha.1";
|
||||
opts.ZeroPath = "/zero";
|
||||
opts.TokenExpiration = TimeSpan.FromHours(3);
|
||||
});
|
||||
services.AddTransient<IZeroOptions>(factory => factory.GetService<IOptionsMonitor<ZeroOptions>>().CurrentValue);
|
||||
opts.TokenExpiration = TimeSpan.FromHours(3);
|
||||
}).Bind(config.GetSection("Zero"));
|
||||
services.AddTransient<IZeroOptions, ZeroOptions>(factory => factory.GetService<IOptions<ZeroOptions>>().Value);
|
||||
|
||||
services.AddOptions<FeatureOptions>().Bind(config.GetSection("Zero:Features"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user