예제 #1
0
        private SqlDialect GetDialect()
        {
            using (var connection = Factory.CreateConnection())
            {
                connection.ConnectionString = ConnectionString;
                connection.Open();

                return(SqlDialect.GetDialectFor(connection));
            }
        }
예제 #2
0
        public AdoNetConnectionFactory(string connectionString, string providerName)
        {
            _connectionString = connectionString;
            _providerName     = providerName;
            _factory          = DbProviderFactories.GetFactory(providerName);
            _dialect          = SqlDialect.GetDialectFor(_factory, connectionString);

            if (_dialect == null)
            {
                throw new InvalidOperationException($"Unable to guess dialect for: {connectionString}");
            }
        }
예제 #3
0
        public AdoNetConnectionFactory(string connectionString, string providerName)
        {
            _connectionString = connectionString;
            _factory          = DbProviderFactories.GetFactory(providerName);
            _dialect          = SqlDialect.GetDialectFor(_factory, connectionString);

            if (_dialect == null)
            {
                throw new InvalidOperationException($"Unable to guess dialect for: {connectionString}");
            }

            _log.Info("Created new connection factory for {0}, using dialect {1}.", _factory.GetType().Name, _dialect.GetType().Name);
        }