Пример #1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="System.Web.Http.Dispatcher.DefaultHttpControllerSelector" /> class.
        /// </summary>
        /// <param name="configuration"> The configuration. </param>
        protected VersionedControllerSelector(HttpConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            this._controllerInfoCache =
                new Lazy <ConcurrentDictionary <ControllerIdentification, HttpControllerDescriptor> >(this.InitializeControllerInfoCache);
            this._configuration       = configuration;
            this._controllerTypeCache = new HttpControllerTypeCache(this._configuration);
        }
Пример #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="System.Web.Http.Dispatcher.DefaultHttpControllerSelector" /> class.
        /// </summary>
        /// <param name="configuration"> The configuration. </param>
        public VersionedApiControllerSelector(HttpConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            this._controllerInfoCache =
                new Lazy <ConcurrentDictionary <ControllerIdentification, HttpControllerDescriptor> >(this.InitializeControllerInfoCache);
            this._requestControllerIdentificationDetector = new Lazy <IRequestControllerIdentificationDetector>(() => this._configuration.DependencyResolver.GetRequestControllerIdentificationDetector());
            this._configuration       = configuration;
            this._controllerTypeCache = new HttpControllerTypeCache(this._configuration);
        }