// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Net.Http; using System.Web.Http.Controllers; namespace System.Web.Http.Routing { /// /// defines the interface for a route expressing how to map an incoming to a particular controller /// and action. /// public interface IHttpRoute { /// /// Gets the route template describing the URI pattern to match against. /// string RouteTemplate { get; } /// /// Gets the default values for route parameters if not provided by the incoming . /// IDictionary Defaults { get; } /// /// Gets the constraints for the route parameters. /// IDictionary Constraints { get; } /// /// Gets any additional data tokens not used directly to determine whether a route matches an incoming . /// IDictionary DataTokens { get; } /// /// Gets the message handler that will be the recipient of the request. If null, the default handler will /// be used (which dispatches messages to implementations of ). /// HttpMessageHandler Handler { get; } /// /// Determine whether this route is a match for the incoming request by looking up the for the route. /// /// The virtual path root. /// The request. /// The for a route if matches; otherwise null. IHttpRouteData GetRouteData(string virtualPathRoot, HttpRequestMessage request); /// /// Compute a URI based on the route and the values provided. /// /// The request message. /// The values. /// IHttpVirtualPathData GetVirtualPath(HttpRequestMessage request, IDictionary values); } }