Share via


LinkGeneratorRouteValuesAddressExtensions.GetUriByRouteValues 方法

定义

重载

GetUriByRouteValues(LinkGenerator, String, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions)

根据提供的值生成绝对 URI。

GetUriByRouteValues(LinkGenerator, String, Object, String, HostString, PathString, FragmentString, LinkOptions)

根据提供的值生成绝对 URI。

GetUriByRouteValues(LinkGenerator, HttpContext, String, RouteValueDictionary, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

根据提供的值生成绝对 URI。

GetUriByRouteValues(LinkGenerator, HttpContext, String, Object, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

根据提供的值生成绝对 URI。

GetUriByRouteValues(LinkGenerator, String, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions)

根据提供的值生成绝对 URI。

public static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary values, string scheme, Microsoft.AspNetCore.Http.HostString host, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * string * Microsoft.AspNetCore.Routing.RouteValueDictionary * string * Microsoft.AspNetCore.Http.HostString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, routeName As String, values As RouteValueDictionary, scheme As String, host As HostString, Optional pathBase As PathString = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

参数

routeName
String

路由名称。 用于解析终结点。 可选。

values
RouteValueDictionary

路由值。 用于解析路由模板中的终结点和展开参数。

scheme
String

URI 方案,应用于生成的 URI。

host
HostString

应用于生成的 URI 的 URI 主机/颁发机构。 有关 的安全影响 host的详细信息,请参阅备注部分。

pathBase
PathString

可选的 URI 路径基。 追加到生成的 URI 中的路径前面。

fragment
FragmentString

可选的 URI 片段。 追加到生成的 URI。

options
LinkOptions

一个可选的 LinkOptions。 提供的 对象上的设置将覆盖具有匹配名称的设置 RouteOptions

返回

绝对 URI 或 null

注解

的值 host 应为受信任的值。 依赖当前请求的值可能会允许不受信任的输入影响生成的 URI, Host 除非标头已经过验证。 有关如何在部署环境中正确验证标头的说明, Host 请参阅部署文档。

适用于

GetUriByRouteValues(LinkGenerator, String, Object, String, HostString, PathString, FragmentString, LinkOptions)

Source:
LinkGeneratorRouteValuesAddressExtensions.cs

根据提供的值生成绝对 URI。

public static string GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string routeName, object values, string scheme, Microsoft.AspNetCore.Http.HostString host, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions options = default);
public static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string? routeName, object? values, string scheme, Microsoft.AspNetCore.Http.HostString host, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * string * obj * string * Microsoft.AspNetCore.Http.HostString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, routeName As String, values As Object, scheme As String, host As HostString, Optional pathBase As PathString = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

参数

routeName
String

路由名称。 用于解析终结点。 可选。

values
Object

路由值。 用于解析路由模板中的终结点和展开参数。 可选。

scheme
String

URI 方案,应用于生成的 URI。

host
HostString

应用于生成的 URI 的 URI 主机/颁发机构。 有关 的安全影响 host的详细信息,请参阅备注部分。

pathBase
PathString

可选的 URI 路径基。 追加到生成的 URI 中的路径前面。

fragment
FragmentString

可选的 URI 片段。 追加到生成的 URI。

options
LinkOptions

一个可选的 LinkOptions。 提供的 对象上的设置将覆盖具有匹配名称的设置 RouteOptions

返回

绝对 URI 或 null

注解

的值 host 应为受信任的值。 依赖当前请求的值可能会允许不受信任的输入影响生成的 URI, Host 除非标头已经过验证。 有关如何在部署环境中正确验证标头的说明, Host 请参阅部署文档。

适用于

GetUriByRouteValues(LinkGenerator, HttpContext, String, RouteValueDictionary, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

根据提供的值生成绝对 URI。

public static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? values = default, string? scheme = default, Microsoft.AspNetCore.Http.HostString? host = default, Microsoft.AspNetCore.Http.PathString? pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * Microsoft.AspNetCore.Http.HttpContext * string * Microsoft.AspNetCore.Routing.RouteValueDictionary * string * Nullable<Microsoft.AspNetCore.Http.HostString> * Nullable<Microsoft.AspNetCore.Http.PathString> * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, httpContext As HttpContext, routeName As String, Optional values As RouteValueDictionary = Nothing, Optional scheme As String = Nothing, Optional host As Nullable(Of HostString) = Nothing, Optional pathBase As Nullable(Of PathString) = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

参数

httpContext
HttpContext

HttpContext与当前请求关联的 。

routeName
String

路由名称。 用于解析终结点。 可选。

values
RouteValueDictionary

路由值。 用于解析路由模板中的终结点和展开参数。 可选。

scheme
String

URI 方案,应用于生成的 URI。 可选。 如果未提供,将使用 的值 Scheme

host
Nullable<HostString>

应用于生成的 URI 的 URI 主机/颁发机构。 可选。 如果未提供,则将使用 值 Host 。 有关 的安全影响 host的详细信息,请参阅备注部分。

pathBase
Nullable<PathString>

可选的 URI 路径基。 追加到生成的 URI 中的路径前面。 如果未提供,将使用 的值 PathBase

fragment
FragmentString

可选的 URI 片段。 追加到生成的 URI。

options
LinkOptions

一个可选的 LinkOptions。 提供的 对象上的设置将覆盖具有匹配名称的设置 RouteOptions

返回

具有绝对路径的 URI,或 null

注解

的值 host 应为受信任的值。 依赖当前请求的值可能会允许不受信任的输入影响生成的 URI, Host 除非标头已经过验证。 有关如何在部署环境中正确验证标头的说明, Host 请参阅部署文档。

适用于

GetUriByRouteValues(LinkGenerator, HttpContext, String, Object, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

Source:
LinkGeneratorRouteValuesAddressExtensions.cs

根据提供的值生成绝对 URI。

public static string GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string routeName, object values, string scheme = default, Microsoft.AspNetCore.Http.HostString? host = default, Microsoft.AspNetCore.Http.PathString? pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions options = default);
public static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string? routeName, object? values, string? scheme = default, Microsoft.AspNetCore.Http.HostString? host = default, Microsoft.AspNetCore.Http.PathString? pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * Microsoft.AspNetCore.Http.HttpContext * string * obj * string * Nullable<Microsoft.AspNetCore.Http.HostString> * Nullable<Microsoft.AspNetCore.Http.PathString> * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, httpContext As HttpContext, routeName As String, values As Object, Optional scheme As String = Nothing, Optional host As Nullable(Of HostString) = Nothing, Optional pathBase As Nullable(Of PathString) = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

参数

httpContext
HttpContext

HttpContext与当前请求关联的 。

routeName
String

路由名称。 用于解析终结点。 可选。

values
Object

路由值。 用于解析路由模板中的终结点和展开参数。 可选。

scheme
String

URI 方案,应用于生成的 URI。 可选。 如果未提供,将使用 的值 Scheme

host
Nullable<HostString>

应用于生成的 URI 的 URI 主机/颁发机构。 可选。 如果未提供,则将使用 值 Host 。 有关 的安全影响 host的详细信息,请参阅备注部分。

pathBase
Nullable<PathString>

可选的 URI 路径基。 追加到生成的 URI 中的路径前面。 如果未提供,将使用 的值 PathBase

fragment
FragmentString

可选的 URI 片段。 追加到生成的 URI。

options
LinkOptions

一个可选的 LinkOptions。 提供的 对象上的设置将替代具有匹配名称的设置 RouteOptions

返回

具有绝对路径的 URI 或 null

注解

的值 host 应为受信任的值。 依赖当前请求的值可能会允许不受信任的输入影响生成的 URI, Host 除非标头已经过验证。 有关如何在部署环境中正确验证标头的说明, Host 请参阅部署文档。

适用于