Пример #1
0
        internal IOperationScope BeginChildScope(string name, Action <IOperationScope> configAction = null)
        {
            var newScope = new LocalOperationScope(this, Current, name);

            configAction?.Invoke(newScope);

            return(newScope);
        }
Пример #2
0
        internal IOperationScope EndScope(LocalOperationScope scope)
        {
            if (!Equals(scope, Current))
            {
                throw new InvalidOperationException($"Cannot finilize scope '{scope}' before finalizing his child scopes");
            }

            _localOperationScope.Value = scope.ParentOperationScope;
            return(_localOperationScope.Value);
        }