共用方式為


LinkGenerator.GetPathByAddress 方法

定義

多載

GetPathByAddress<TAddress>(TAddress, RouteValueDictionary, PathString, FragmentString, LinkOptions)

根據提供的值產生具有絕對路徑的 URI。

GetPathByAddress<TAddress>(HttpContext, TAddress, RouteValueDictionary, RouteValueDictionary, Nullable<PathString>, FragmentString, LinkOptions)

根據提供的值和 HttpContext ,產生具有絕對路徑的 URI。

GetPathByAddress<TAddress>(TAddress, RouteValueDictionary, PathString, FragmentString, LinkOptions)

來源:
LinkGenerator.cs

根據提供的值產生具有絕對路徑的 URI。

public abstract string GetPathByAddress<TAddress> (TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions options = default);
public abstract string? GetPathByAddress<TAddress> (TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
abstract member GetPathByAddress : 'Address * Microsoft.AspNetCore.Routing.RouteValueDictionary * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
Public MustOverride Function GetPathByAddress(Of TAddress) (address As TAddress, values As RouteValueDictionary, Optional pathBase As PathString = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

類型參數

TAddress

網址類別型。

參數

address
TAddress

位址值。 用來解析端點。

values
RouteValueDictionary

路徑值。 用來展開路由範本中的參數。

pathBase
PathString

選擇性 URI 路徑基底。 在產生的 URI 中,前面加上路徑。

fragment
FragmentString

選擇性 URI 片段。 附加至產生的 URI。

options
LinkOptions

選擇性 LinkOptions。 所提供物件的設定會覆寫具有相符名稱的 RouteOptions 設定。

傳回

具有絕對路徑的 URI,或 null

適用於

GetPathByAddress<TAddress>(HttpContext, TAddress, RouteValueDictionary, RouteValueDictionary, Nullable<PathString>, FragmentString, LinkOptions)

來源:
LinkGenerator.cs

根據提供的值和 HttpContext ,產生具有絕對路徑的 URI。

public abstract string GetPathByAddress<TAddress> (Microsoft.AspNetCore.Http.HttpContext httpContext, TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Routing.RouteValueDictionary ambientValues = default, Microsoft.AspNetCore.Http.PathString? pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions options = default);
public abstract string? GetPathByAddress<TAddress> (Microsoft.AspNetCore.Http.HttpContext httpContext, TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Routing.RouteValueDictionary? ambientValues = default, Microsoft.AspNetCore.Http.PathString? pathBase = default, Microsoft.AspNetCore.Http.FragmentString fragment = default, Microsoft.AspNetCore.Routing.LinkOptions? options = default);
abstract member GetPathByAddress : Microsoft.AspNetCore.Http.HttpContext * 'Address * Microsoft.AspNetCore.Routing.RouteValueDictionary * Microsoft.AspNetCore.Routing.RouteValueDictionary * Nullable<Microsoft.AspNetCore.Http.PathString> * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
Public MustOverride Function GetPathByAddress(Of TAddress) (httpContext As HttpContext, address As TAddress, values As RouteValueDictionary, Optional ambientValues As RouteValueDictionary = Nothing, Optional pathBase As Nullable(Of PathString) = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

類型參數

TAddress

網址類別型。

參數

httpContext
HttpContext

HttpContext 目前要求相關聯的 。

address
TAddress

位址值。 用來解析端點。

values
RouteValueDictionary

路徑值。 用來展開路由範本中的參數。

ambientValues
RouteValueDictionary

與目前要求相關聯的值。 選擇性。

pathBase
Nullable<PathString>

選擇性 URI 路徑基底。 在產生的 URI 中,前面加上路徑。 如果未提供,則會使用 的值 PathBase

fragment
FragmentString

選擇性 URI 片段。 附加至產生的 URI。

options
LinkOptions

選擇性 LinkOptions。 所提供物件的設定會覆寫具有相符名稱的 RouteOptions 設定。

傳回

具有絕對路徑的 URI,或 null

適用於