ObtainCurrentScope() публичный статический Метод

public static ObtainCurrentScope ( ) : ThreadStaticLifetimeScope
Результат ThreadStaticLifetimeScope
Пример #1
0
        public void Dispose()
        {
            var scope = Scope.ObtainCurrentScope();

            if (scope != null)
            {
                scope.Dispose();
            }
        }
Пример #2
0
        public ILifetimeScope GetScope(CreationContext context)
        {
            var scope = Scope.ObtainCurrentScope();

            if (scope == null)
            {
                throw new InvalidOperationException("Scope was not available. Did you forget to call container.BeginScope()?");
            }
            return(scope);
        }