public IDbConnection GetOpenConnection()
        {
            //if (_fixture.Dialect == SimpleCRUD.Dialect.PostgreSQL)
            //{
            //    connection = new NpgsqlConnection(String.Format("Server={0};Port={1};User Id={2};Password={3};Database={4};", "localhost", "5432", "postgres", "postgrespass", "testdb"));
            //    SimpleCRUD.SetDialect(SimpleCRUD.Dialect.PostgreSQL);
            //}
            //else if (_fixture.Dialect == SimpleCRUD.Dialect.SQLite)
            //{
            var connection = new SqliteConnection(ConnectionString);

            ExtendedCRUD.SetDialect(ExtendedCRUD.Dialect.SQLite);
            //}
            //else if (_fixture.Dialect == SimpleCRUD.Dialect.MySQL)
            //{
            //    connection = new MySqlConnection(String.Format("Server={0};Port={1};User Id={2};Password={3};Database={4};", "localhost", "3306", "root", "admin", "testdb"));
            //    SimpleCRUD.SetDialect(SimpleCRUD.Dialect.MySQL);
            //}
            //else
            //{
            //    connection = new SqlConnection(@"Data Source = .\sqlexpress;Initial Catalog=DapperSimpleCrudTestDb;Integrated Security=True;MultipleActiveResultSets=true;");
            //    SimpleCRUD.SetDialect(SimpleCRUD.Dialect.SQLServer);
            //}

            connection.Open();
            return(connection);
        }
Ejemplo n.º 2
0
        public IDbConnection GetOpenConnection()
        {
            var connection = new SqlConnection(ConnectionString);

            ExtendedCRUD.SetDialect(ExtendedCRUD.Dialect.SQLServer);
            connection.Open();
            return(connection);
        }
Ejemplo n.º 3
0
        public IDbConnection GetOpenConnection()
        {
            var connection = new NpgsqlConnection(ConnectionString);

            ExtendedCRUD.SetDialect(ExtendedCRUD.Dialect.PostgreSQL);
            connection.Open();
            return(connection);
        }