// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. using System.Web.Routing; namespace System.Web.Http.WebHost { /// /// A that returns instances of that /// can pass requests to a given instance. /// public class HttpControllerRouteHandler : IRouteHandler { private static readonly Lazy _instance = new Lazy(() => new HttpControllerRouteHandler(), isThreadSafe: true); /// /// Initializes a new instance of the class. /// protected HttpControllerRouteHandler() { } /// /// Gets the singleton instance. /// public static HttpControllerRouteHandler Instance { get { return _instance.Value; } } /// /// Provides the object that processes the request. /// /// An object that encapsulates information about the request. /// /// An object that processes the request. /// IHttpHandler IRouteHandler.GetHttpHandler(RequestContext requestContext) { return GetHttpHandler(requestContext); } /// /// Provides the object that processes the request. /// /// An object that encapsulates information about the request. /// /// An object that processes the request. /// protected virtual IHttpHandler GetHttpHandler(RequestContext requestContext) { return new HttpControllerHandler(requestContext.RouteData); } } }