Пример #1
0
        public int SaveChanges()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(nameof(DbContextScope));
            }

            if (_completed)
            {
                throw new Exception("Cannot call SaveChanges() more than once.");
            }

            var committed = 0;

            if (!_nested)
            {
                DbContexts.Commit();
            }

            _completed = true;

            return(committed);
        }