Esempio n. 1
0
        /// <summary>
        /// Gets the handler.
        /// </summary>
        /// <param name="handlerInfo">The handler info.</param>
        /// <returns></returns>
        public IScopedHandler GetHandler(HandlerInfo handlerInfo)
        {
            var builderDictionary = _builders.GetOrAdd(handlerInfo.HttpMethod,
                                                       _ =>
                                                       new ConcurrentDictionary
                                                           <Type, Func<IDictionary<string, string>, IScopedHandler>>());

            var builder = builderDictionary.GetOrAdd(handlerInfo.HandlerType, _handlerBuilderFactory.BuildHandlerBuilder);
            return builder(handlerInfo.Variables);
        }