Ejemplo n.º 1
0
        /// <summary>
        /// Add a new Lifetime scope provider.
        /// </summary>
        /// <param name="uniqueContainerKey">The unique container key</param>
        /// <param name="requestLifetimeScopeProvider">The provider to add in the dictionary</param>
        public static void AddRequestLifetimeScopeProvider(string uniqueContainerKey, SPRequestLifetimeScopeProvider requestLifetimeScopeProvider)
        {
            if (string.IsNullOrEmpty(uniqueContainerKey))
            {
                throw new ArgumentNullException("uniqueContainerKey");
            }

            if (requestLifetimeScopeProvider == null)
            {
                throw new ArgumentNullException("requestLifetimeScopeProvider");
            }

            // Add to dictionary of (there can be a different per-request lifetime provider for each container in the AppDomain)
            allLifetimeScopeProviders[uniqueContainerKey] = requestLifetimeScopeProvider;
        }
        /// <summary>
        /// Add a new Lifetime scope provider.
        /// </summary>
        /// <param name="uniqueContainerKey">The unique container key</param>
        /// <param name="requestLifetimeScopeProvider">The provider to add in the dictionary</param>
        public static void AddRequestLifetimeScopeProvider(string uniqueContainerKey, SPRequestLifetimeScopeProvider requestLifetimeScopeProvider)
        {
            if (string.IsNullOrEmpty(uniqueContainerKey))
            {
                throw new ArgumentNullException("uniqueContainerKey");
            }

            if (requestLifetimeScopeProvider == null)
            {
                throw new ArgumentNullException("requestLifetimeScopeProvider");
            }

            // Add to dictionary of (there can be a different per-request lifetime provider for each container in the AppDomain)
            allLifetimeScopeProviders[uniqueContainerKey] = requestLifetimeScopeProvider;
        }