public static bool InitializeDatabaseAccessClasses(IDataContextHandler dataContextHandler, IDatabaseConnectionConfigurationStorage configurationStorage, bool showConfigurationInterface, params Type[] dbContextTypes) { DataContextManager.Initialize(dataContextHandler); foreach (var dbType in dbContextTypes) { dataContextHandler.RegisterDataContextType(dbType); if (!DatabaseConnectionConfigurator.CheckDatabaseConnection(dbType.Name, configurationStorage, (conf) => dataContextHandler.CheckConnectionForDataContext(dbType, conf), showConfigurationInterface)) { return(false); } } return(true); }
public static void InitializeDatabaseAccessClasses(IDataContextHandler dataContextHandler, IDatabaseConnectionConfigurationStorage configurationStorage, IDatabaseConnectionConfigurator connectionConfigurator, params Type[] dbContextTypes) { DatabaseConnectionConfigurationStorage = configurationStorage; DatabaseConnectionConfigurator = connectionConfigurator; DataContextManager.Initialize(dataContextHandler); DatabaseConnectionManager.Initialize(configurationStorage); foreach (var dbType in dbContextTypes) { dataContextHandler.RegisterDataContextType(dbType); } }