/// <summary> /// <inheritdoc cref="ModulesBootstrapper"/> /// </summary> /// <param name="moduleInstances"></param> /// <param name="modulesBootstrapInterceptor"></param> /// <param name="options"></param> public ModulesBootstrapper(object[] moduleInstances, IModulesBootstrapInterceptor modulesBootstrapInterceptor, ModulesBootstrapOptions options) { if (moduleInstances.IsNullOrEmpty()) { throw new ModularityException($"{nameof(moduleInstances)} cannot be null or empty."); } _modulesBootstrapInterceptor = modulesBootstrapInterceptor ?? throw new ArgumentNullException(nameof(modulesBootstrapInterceptor)); _options = options ?? throw new ArgumentNullException(nameof(options)); Modules = moduleInstances.ToList().AsReadOnly(); }
private static IHostBuilder InternalAddBootstrapInterceptor(this IHostBuilder hostBuilder, IModulesBootstrapInterceptor interceptor) { return(hostBuilder.InternalOptionModuleLoadBuilder(options => { options.ModulesBootstrapInterceptors.Add(interceptor); })); }