Exemple #1
0
        /// <summary>
        /// The begin scope.
        /// </summary>
        /// <returns>
        /// The System.Web.Http.Dependencies.IDependencyScope.
        /// </returns>
        public IDependencyScope BeginScope()
        {
            var resolver = new StructureMapWebApiDependencyResolver(CurrentNestedContainer);

            ServiceLocatorProvider provider = () => resolver;

            CurrentNestedContainer.Configure(cfg => cfg.For <ServiceLocatorProvider>().Use(provider));

            return(resolver);
        }
        /// <summary>
        /// The begin scope.
        /// </summary>
        /// <returns>
        /// The System.Web.Http.Dependencies.IDependencyScope.
        /// </returns>
        public IDependencyScope BeginScope()
        {
            var resolver = new StructureMapWebApiDependencyResolver(CurrentNestedContainer);

            ServiceLocatorProvider provider = () => resolver;

            CurrentNestedContainer.Configure(cfg => cfg.For<ServiceLocatorProvider>().Use(provider));

            return resolver;
        }