Share via


LinkGeneratorEndpointNameAddressExtensions.GetPathByName 方法

定义

重载

GetPathByName(LinkGenerator, String, RouteValueDictionary, PathString, FragmentString, LinkOptions)

根据提供的值生成具有绝对路径的 URI。

GetPathByName(LinkGenerator, String, Object, PathString, FragmentString, LinkOptions)

根据提供的值生成具有绝对路径的 URI。

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

根据提供的值生成具有绝对路径的 URI。

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

根据提供的值生成具有绝对路径的 URI。

GetPathByName(LinkGenerator, String, RouteValueDictionary, PathString, FragmentString, LinkOptions)

根据提供的值生成具有绝对路径的 URI。

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

参数

endpointName
String

端点名称。 用于解析终结点。

values
RouteValueDictionary

路由值。 用于展开路由模板中的参数。 可选。

pathBase
PathString

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

fragment
FragmentString

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

options
LinkOptions

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

返回

具有绝对路径的 URI 或 null

适用于

GetPathByName(LinkGenerator, String, Object, PathString, FragmentString, LinkOptions)

Source:
LinkGeneratorEndpointNameAddressExtensions.cs

根据提供的值生成具有绝对路径的 URI。

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

参数

endpointName
String

端点名称。 用于解析终结点。

values
Object

路由值。 用于展开路由模板中的参数。 可选。

pathBase
PathString

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

fragment
FragmentString

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

options
LinkOptions

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

返回

具有绝对路径的 URI 或 null

适用于

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

根据提供的值生成具有绝对路径的 URI。

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

参数

httpContext
HttpContext

HttpContext 当前请求关联的 。

endpointName
String

端点名称。 用于解析终结点。

values
RouteValueDictionary

路由值。 用于展开路由模板中的参数。 可选。

pathBase
Nullable<PathString>

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

fragment
FragmentString

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

options
LinkOptions

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

返回

具有绝对路径的 URI 或 null

适用于

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

Source:
LinkGeneratorEndpointNameAddressExtensions.cs

根据提供的值生成具有绝对路径的 URI。

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

参数

httpContext
HttpContext

HttpContext 当前请求关联的 。

endpointName
String

端点名称。 用于解析终结点。

values
Object

路由值。 用于展开路由模板中的参数。 可选。

pathBase
Nullable<PathString>

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

fragment
FragmentString

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

options
LinkOptions

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

返回

具有绝对路径的 URI 或 null

适用于