Beispiel #1
0
        private IDbConnection CreateConnection(DataOption option)
        {
            IDbConnection dbConnection = null;

            if (option.databaseType == DatabaseType.MySql)
            {
                dbConnection = new MySqlConnection(dataOptionProvider.GetDataOption().ConnectString);
            }
            else if (option.databaseType == DatabaseType.MSSqlServer)
            {
                dbConnection = new SqlConnection(dataOptionProvider.GetDataOption().ConnectString);
            }
            return(dbConnection);
        }
Beispiel #2
0
 public DataBase(IDataOptionProvider _dataOptionProvider)
 {
     dataOptionProvider = _dataOptionProvider;
     option             = dataOptionProvider.GetDataOption();
 }