Esempio n. 1
0
		public void Dispose()
		{
			foreach (var localDbReposetoryBase in LocalDbManager.Scope.Database)
			{
				localDbReposetoryBase.Value.IsMigrating = false;
			}
			_current = null;
		}
Esempio n. 2
0
        /// <summary>
        ///     Submits all pending changes
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            ReleaseUnmanagedResources();

            foreach (var localDbReposetoryBase in LocalDbManager.Scope.Database)
            {
                localDbReposetoryBase.Value.IsMigrating = false;
            }
            _current = null;
        }
Esempio n. 3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ReplicationScope" /> class.
        /// </summary>
        /// <exception cref="InvalidOperationException">
        ///     Nested Identity Scopes are not supported
        ///     or
        ///     Has to be executed inside a valid TransactionScope
        /// </exception>
        public ReplicationScope()
        {
            if (Current != null)
            {
                throw new InvalidOperationException("Nested Identity Scopes are not supported");
            }
            if (Transaction.Current == null)
            {
                throw new InvalidOperationException("Has to be executed inside a valid TransactionScope");
            }

            _current = this;

            foreach (var localDbReposetoryBase in LocalDbManager.Scope.Database)
            {
                localDbReposetoryBase.Value.IsMigrating = true;
            }
        }