Beispiel #1
0
 /// <summary>
 /// Flushes the changes made in the unit of work to the data store
 /// within a transaction with the specified isolation level.
 /// </summary>
 /// <param name="isolationLevel"></param>
 public void TransactionalFlush(IsolationLevel isolationLevel)
 {
     // Start a transaction if one isn't already running.
     if (!IsInTransaction)
     {
         BeginTransaction(isolationLevel);
     }
     try
     {
         _linqContext.SubmitChanges();
         _transaction.Commit();
     }
     catch
     {
         _transaction.Rollback();
         throw;
     }
 }