@@ -16,11 +16,13 @@ public interface IUrlHelper
16
16
ActionContext ActionContext { get ; }
17
17
18
18
/// <summary>
19
- /// Generates a fully qualified or absolute URL specified by <see cref="UrlActionContext"/> for an action
20
- /// method, which contains action name, controller name, route values, protocol to use, host name, and fragment.
19
+ /// Generates a URL with an absolute path for an action method, which contains the action
20
+ /// name, controller name, route values, protocol to use, host name, and fragment specified by
21
+ /// <see cref="UrlActionContext"/>. Generates an absolute URL if <see cref="UrlActionContext.Protocol"/> and
22
+ /// <see cref="UrlActionContext.Host"/> are non-<c>null</c>.
21
23
/// </summary>
22
24
/// <param name="actionContext">The context object for the generated URLs for an action method.</param>
23
- /// <returns>The fully qualified or absolute URL to an action method .</returns>
25
+ /// <returns>The generated URL.</returns>
24
26
string Action ( UrlActionContext actionContext ) ;
25
27
26
28
/// <summary>
@@ -35,43 +37,47 @@ public interface IUrlHelper
35
37
string Content ( string contentPath ) ;
36
38
37
39
/// <summary>
38
- /// Returns a value that indicates whether the URL is local. A URL with an absolute path is considered local
39
- /// if it does not have a host/authority part . URLs using virtual paths ('~/') are also local.
40
+ /// Returns a value that indicates whether the URL is local. A URL is considered local if it does not have a
41
+ /// host / authority part and it has an absolute path . URLs using virtual paths ('~/') are also local.
40
42
/// </summary>
41
43
/// <param name="url">The URL.</param>
42
44
/// <returns><c>true</c> if the URL is local; otherwise, <c>false</c>.</returns>
43
45
/// <example>
44
46
/// <para>
45
47
/// For example, the following URLs are considered local:
48
+ /// <code>
46
49
/// /Views/Default/Index.html
47
50
/// ~/Index.html
51
+ /// </code>
48
52
/// </para>
49
53
/// <para>
50
54
/// The following URLs are non-local:
55
+ /// <code>
51
56
/// ../Index.html
52
57
/// http://www.contoso.com/
53
58
/// http://localhost/Index.html
59
+ /// </code>
54
60
/// </para>
55
61
/// </example>
56
62
bool IsLocalUrl ( string url ) ;
57
63
58
64
/// <summary>
59
- /// Generates a fully qualified or absolute URL specified by <see cref="UrlRouteContext"/>, which
60
- /// contains the route name, the route values, protocol to use, host name and fragment.
65
+ /// Generates a URL with an absolute path, which contains the route name, route values, protocol to use, host
66
+ /// name, and fragment specified by <see cref="UrlRouteContext"/>. Generates an absolute URL if
67
+ /// <see cref="UrlActionContext.Protocol"/> and <see cref="UrlActionContext.Host"/> are non-<c>null</c>.
61
68
/// </summary>
62
69
/// <param name="routeContext">The context object for the generated URLs for a route.</param>
63
- /// <returns>The fully qualified or absolute URL.</returns>
70
+ /// <returns>The generated URL.</returns>
64
71
string RouteUrl ( UrlRouteContext routeContext ) ;
65
72
66
73
/// <summary>
67
- /// Generates an absolute URL using the specified route name and values.
74
+ /// Generates an absolute URL for the specified <paramref name="routeName"/> and route
75
+ /// <paramref name="values"/>, which contains the protocol (such as "http" or "https") and host name from the
76
+ /// current request.
68
77
/// </summary>
69
- /// <param name="routeName">The name of the route that is used to generate the URL.</param>
70
- /// <param name="values">An object that contains the route values.</param>
78
+ /// <param name="routeName">The name of the route that is used to generate URL.</param>
79
+ /// <param name="values">An object that contains route values.</param>
71
80
/// <returns>The generated absolute URL.</returns>
72
- /// <remarks>
73
- /// The protocol and host is obtained from the current request.
74
- /// </remarks>
75
81
string Link ( string routeName , object values ) ;
76
82
}
77
83
}
0 commit comments