public void Dispose() { foreach (var localDbReposetoryBase in LocalDbManager.Scope.Database) { localDbReposetoryBase.Value.IsMigrating = false; } _current = null; }
/// <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; }
/// <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; } }