/// <summary>
        /// Begins a dependency scope.
        /// </summary>
        public IDependencyScope BeginScope()
        {
            // Unity represents dependency scopes as child containers.
            IUnityContainer unityChildContainer = this.unityContainer.CreateChildContainer();

            // Build the dependency scope.
            IDependencyScope dependencyScope = new DependencyScope(unityChildContainer);
            return dependencyScope;
        }
Example #2
0
        /// <summary>
        /// Begins a dependency scope.
        /// </summary>
        public IDependencyScope BeginScope()
        {
            // Unity represents dependency scopes as child containers.
            IUnityContainer unityChildContainer = this.unityContainer.CreateChildContainer();

            // Build the dependency scope.
            IDependencyScope dependencyScope = new DependencyScope(unityChildContainer);

            return(dependencyScope);
        }