private SqlDialect GetDialect() { using (var connection = Factory.CreateConnection()) { connection.ConnectionString = ConnectionString; connection.Open(); return(SqlDialect.GetDialectFor(connection)); } }
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}"); } }
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); }