forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIHttpRoute.cs
More file actions
58 lines (50 loc) · 2.5 KB
/
Copy pathIHttpRoute.cs
File metadata and controls
58 lines (50 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// 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
{
/// <summary>
/// <see cref="IHttpRoute"/> defines the interface for a route expressing how to map an incoming <see cref="HttpRequestMessage"/> to a particular controller
/// and action.
/// </summary>
public interface IHttpRoute
{
/// <summary>
/// Gets the route template describing the URI pattern to match against.
/// </summary>
string RouteTemplate { get; }
/// <summary>
/// Gets the default values for route parameters if not provided by the incoming <see cref="HttpRequestMessage"/>.
/// </summary>
IDictionary<string, object> Defaults { get; }
/// <summary>
/// Gets the constraints for the route parameters.
/// </summary>
IDictionary<string, object> Constraints { get; }
/// <summary>
/// Gets any additional data tokens not used directly to determine whether a route matches an incoming <see cref="HttpRequestMessage"/>.
/// </summary>
IDictionary<string, object> DataTokens { get; }
/// <summary>
/// Gets the message handler that will be the recipient of the request. If <c>null</c>, the default handler will
/// be used (which dispatches messages to implementations of <see cref="IHttpController"/>).
/// </summary>
HttpMessageHandler Handler { get; }
/// <summary>
/// Determine whether this route is a match for the incoming request by looking up the <see cref="IHttpRouteData"/> for the route.
/// </summary>
/// <param name="virtualPathRoot">The virtual path root.</param>
/// <param name="request">The request.</param>
/// <returns>The <see cref="IHttpRouteData"/> for a route if matches; otherwise <c>null</c>.</returns>
IHttpRouteData GetRouteData(string virtualPathRoot, HttpRequestMessage request);
/// <summary>
/// Compute a URI based on the route and the values provided.
/// </summary>
/// <param name="request">The request message.</param>
/// <param name="values">The values.</param>
/// <returns></returns>
IHttpVirtualPathData GetVirtualPath(HttpRequestMessage request, IDictionary<string, object> values);
}
}