public static void UseExamine(this ISImplHostBuilder simplHostBuilder, Action <ExamineConfig> configurer) { var existingExamineModule = simplHostBuilder.GetConfiguredModule <ExamineModule>(); var examineConfig = existingExamineModule != null ? existingExamineModule.Config : AttachModule(simplHostBuilder); configurer?.Invoke(examineConfig); }
public static void UseWebOAuth(this ISImplHostBuilder webAppBuilder, Action <HttpOAuthConfig> configure = null) { var existingModule = webAppBuilder.GetConfiguredModule <HttpOAuthModule>(); var config = existingModule != null ? existingModule.Config : Attach(webAppBuilder); // Apply user configuration to module configure?.Invoke(config); }
public void PreInit() { // Create discovery service var discoveryStrategy = Config.AutoRunDiscoveryServiceFactory.New(); // Discover and attach modules var autoRunModules = discoveryStrategy.Discover(); foreach (var autoRunModule in autoRunModules) { var module = _host.GetConfiguredModule <ISImplModule>(autoRunModule.ModuleType); if (module is null) { _host.Use(autoRunModule.ModuleFactory.Invoke()); } } }
public TModule GetConfiguredModule <TModule>() where TModule : ISImplModule { return(_hostBuilder.GetConfiguredModule <TModule>()); }