Exemple #1
0
        public ITransaction BeginTransaction(
            IsolationLevel isolationLevel = IsolationLevel.ReadCommitted)
        {
            if (this.Transaction != null)
            {
                throw new Exception("There is already an open transaction");
            }
            var connection  = this.GetConnection();
            var transaction = connection.BeginTransaction(
                isolationLevel);

            return(this.Transaction = new SqlClientTransaction(
                       this,
                       transaction));
        }
Exemple #2
0
 public SqlClientProvider(string connectionString)
 {
     this.connectionString = connectionString;
     this.Transaction      = null;
     this.CreateCollectionInfoTableIfNotExists();
 }