private static void AddHyperion(IServiceCollection collection, IConfiguration configuration, bool addHyperionServices) { if (!addHyperionServices) { return; } HyperionOptions options = SolariBuilderExtensions.ConfigureHyperionOptions(collection, configuration); SolariBuilderExtensions.AddHyperionCoreServices(collection, options); SolariBuilderExtensions.RegisterApplication(collection, options); }
private static IConfigurationBuilder UseHyperion(this IConfigurationBuilder builder, Func <HyperionOptions, HyperionOptions> func) { IConfigurationRoot configRoot = builder.Build(); SolariBuilderExtensions.GetHyperionOptions(configRoot, out HyperionOptions options); if (options.ConfigurationProvider is null || !options.ConfigurationProvider.Enabled) { return(builder); } ApplicationOptions app = configRoot.GetApplicationOptions(); var src = new HyperionConfigurationSource { Options = options, ApplicationOptions = app }; builder.Add(src); return(builder); }