Пример #1
0
        public static EfCfExecutionStrategy GetExecutionStrategy(ILogging logger = null)
        {
            EfCfExecutionStrategy efCfExecutionStrategy = null;

            var dbConfigurationDatabaseType = ConfigurationUtility.GetDbConfigurationDatabaseType();

            switch (dbConfigurationDatabaseType)
            {
            case ConfigurationUtility.DbConfigurationDatabaseType.MsSqlServer:
                efCfExecutionStrategy = new MsSqlServerEfCfExecutionStrategy(logger);
                break;

            case ConfigurationUtility.DbConfigurationDatabaseType.MySql:
                efCfExecutionStrategy = new MySqlEfCfExecutionStrategy(logger);
                break;

            case ConfigurationUtility.DbConfigurationDatabaseType.MariaDb:
                efCfExecutionStrategy = new MySqlEfCfExecutionStrategy(logger);
                break;

            case ConfigurationUtility.DbConfigurationDatabaseType.Sqlite:
                efCfExecutionStrategy = new SqliteEfCfExecutionStrategy(logger);
                break;

            default:
                efCfExecutionStrategy = new MsSqlServerEfCfExecutionStrategy(logger);
                break;
            }

            return(efCfExecutionStrategy);
        }
Пример #2
0
        public static EfCfDbConfiguration GetDbConfiguration()
        {
            EfCfDbConfiguration dbConfiguration = null;

            var dbConfigurationDatabaseType = ConfigurationUtility.GetDbConfigurationDatabaseType();

            switch (dbConfigurationDatabaseType)
            {
            case ConfigurationUtility.DbConfigurationDatabaseType.MsSqlServer:
                dbConfiguration = new MsSqlServerEfCfDbConfiguration();
                break;

            case ConfigurationUtility.DbConfigurationDatabaseType.MySql:
                dbConfiguration = new MySqlEfCfDbConfiguration();
                break;

            case ConfigurationUtility.DbConfigurationDatabaseType.MariaDb:
                dbConfiguration = new MySqlEfCfDbConfiguration();
                break;

            case ConfigurationUtility.DbConfigurationDatabaseType.Sqlite:
                dbConfiguration = new SqliteEfCfDbConfiguration();
                break;

            default:
                dbConfiguration = new MsSqlServerEfCfDbConfiguration();
                break;
            }

            return(dbConfiguration);
        }