示例#1
0
        public static IDbConnection GetIDbConnection
        (
            DatabaseType databaseType,
            string connectionString
        )
        {
            IAVSCDatabase db
                = AVSCDatabaseFactory.GetIAVSCDatabase(
                      databaseType, connectionString);

            return(db.GetDbConnection());
        }
示例#2
0
        public static IDbConnection GetIDbConnection
        (
            DatabaseType databaseType,
            string serverName,
            string username,
            string password,
            string databaseName
        )
        {
            IAVSCDatabase db
                = AVSCDatabaseFactory.GetIAVSCDatabase(
                      databaseType, serverName, username, password, databaseName);

            return(db.GetDbConnection());
        }
示例#3
0
        public static IAVSCDatabase GetIAVSCDatabase
        (
            DatabaseType databaseType,
            string connectionString
        )
        {
            IAVSCDatabase db = null;

            switch (databaseType)
            {
            case DatabaseType.Postgres:
            {
                db = new PostgresDbConnection(connectionString);
            }
            break;

            case DatabaseType.MySql:
            {
                db = new MySqlDbConnection(connectionString);
            }
            break;

            case DatabaseType.SqlServer:
            {
                db = new SqlServerDbConnection(connectionString);
            }
            break;

            default:
            {
                throw new NotSupportedDatabaseException();
            }
            }

            return(db);
        }
示例#4
0
        public static IDbConnection GetInMemoryIDbConnection()
        {
            IAVSCDatabase db = AVSCDatabaseFactory.GetIAVSCInMemoryDatabase();

            return(db.GetDbConnection());
        }