public void Dispose() { if (_isDisposed) { return; } _isDisposed = true; CallOrHttpContextStorage.RemoveValue(ScopeKey); }
public static DomainEventScope Start() { var scope = Instance; if (scope != null) { throw new InvalidOperationException("A scope may not be started if one already exists"); } scope = new DomainEventScope(); CallOrHttpContextStorage.SetValue(ScopeKey, scope); return(scope); }