public static PluggableBuilder AddPlugging([NotNull] this PluggableBuilder builder) { Requires.NotNull(builder, nameof(builder)); builder.Services.Configure <PluggableOptions>(options => options.AddModules(builder.Options.Modules.Values)); builder.Services.TryAddSingleton <IPluggableServiceProvider, PluggableServiceProvider>(); builder.Services.TryAddSingleton(typeof(IPluggableRegistry <>), typeof(PluggableRegistry <>)); return(builder); }
public static PluggableModuleBuilder AddModule( [NotNull] this PluggableBuilder builder, [NotNull] string name) { Requires.NotNull(builder, nameof(builder)); Requires.NotNullOrEmpty(name, nameof(name)); Module module = builder.Options.AddModule(name); return(new PluggableModuleBuilder(builder.Services, module)); }