public IDataProvider Create(CustomConnectionStringSettings settings, Transaction transactionMode) { var provider = ResolveDataProvider(settings.ProviderName); provider.DbConnection = CreateConnection(settings.ProviderName, settings); provider.TransactionMode = transactionMode; return(provider); }
private IDbConnection CreateConnection(string providerName, CustomConnectionStringSettings settings) { IDbConnection connection; if (ConnectionFactory != null) { connection = ConnectionFactory(providerName); } else { connection = DbProviderFactories.GetFactory(providerName).CreateConnection(); } connection.ConnectionString = settings.ConnectionString; return(connection); }