Пример #1
0
 public void CreateDatabase()
 {
     try
     {
         _transaction.Begin();
         _transaction.Commit();
     }
     catch (Exception ex)
     {
         Log.Error("PL-E-CREATEDB, ", ex);
         _transaction.Rollback();
     }
 }
Пример #2
0
        public void Complete()
        {
            if (_isCompleteCalled)
            {
                throw new NotSupportedException("This unit of work has completed.");
            }

            try
            {
                SaveChanges();
                _isCompleteCalled = true;

                if (Options.IsTransactional)
                {
                    _transactionStrategy.Commit();
                }

                _isSucceed = true;
                OnCompleted();
            }
            catch (Exception ex)
            {
                _exception = ex;
                throw;
            }
        }