Share via


LinkGenerator.GetUriByAddress Metodo

Definizione

Overload

GetUriByAddress<TAddress>(TAddress, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions)

Genera un URI assoluto in base ai valori specificati.

GetUriByAddress<TAddress>(HttpContext, TAddress, RouteValueDictionary, RouteValueDictionary, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

Genera un URI assoluto basato sui valori specificati e HttpContext.

GetUriByAddress<TAddress>(TAddress, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions)

Genera un URI assoluto in base ai valori specificati.

public abstract string GetUriByAddress<TAddress> (TAddress address, 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);
public abstract string? GetUriByAddress<TAddress> (TAddress address, 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);
public abstract string? GetUriByAddress<TAddress> (TAddress address, 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);
abstract member GetUriByAddress : 'Address * Microsoft.AspNetCore.Routing.RouteValueDictionary * string * Microsoft.AspNetCore.Http.HostString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
Public MustOverride Function GetUriByAddress(Of TAddress) (address As TAddress, 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

Parametri di tipo

TAddress

Tipo di indirizzo.

Parametri

address
TAddress

Valore dell'indirizzo. Usato per risolvere gli endpoint.

values
RouteValueDictionary

Valori della route. Usato per espandere i parametri nel modello di route.

scheme
String

Schema URI applicato all'URI risultante.

host
HostString

Host/autorità URI applicato all'URI risultante. Vedere la sezione osservazioni per informazioni dettagliate sulle implicazioni di sicurezza di host.

pathBase
PathString

Base del percorso URI facoltativo. Anteporre al percorso nell'URI risultante.

fragment
FragmentString

Frammento di URI facoltativo. Aggiunto all'URI risultante.

options
LinkOptions

Oggetto LinkOptions facoltativo. Le impostazioni sull'oggetto specificato eseguono l'override delle impostazioni con nomi corrispondenti da RouteOptions.

Restituisce

URI assoluto o null.

Commenti

Il valore di host deve essere un valore attendibile. Basandosi sul valore della richiesta corrente, è possibile consentire all'input non attendibile di influenzare l'URI risultante, a meno che l'intestazione Host non sia stata convalidata. Per istruzioni su come convalidare correttamente l'intestazione nell'ambiente Host di distribuzione, vedere la documentazione sulla distribuzione.

Si applica a

GetUriByAddress<TAddress>(HttpContext, TAddress, RouteValueDictionary, RouteValueDictionary, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

Genera un URI assoluto basato sui valori specificati e HttpContext.

public abstract string GetUriByAddress<TAddress> (Microsoft.AspNetCore.Http.HttpContext httpContext, TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Routing.RouteValueDictionary ambientValues = 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);
public abstract string? GetUriByAddress<TAddress> (Microsoft.AspNetCore.Http.HttpContext httpContext, TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Routing.RouteValueDictionary? ambientValues = 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);
abstract member GetUriByAddress : Microsoft.AspNetCore.Http.HttpContext * 'Address * Microsoft.AspNetCore.Routing.RouteValueDictionary * Microsoft.AspNetCore.Routing.RouteValueDictionary * string * Nullable<Microsoft.AspNetCore.Http.HostString> * Nullable<Microsoft.AspNetCore.Http.PathString> * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
Public MustOverride Function GetUriByAddress(Of TAddress) (httpContext As HttpContext, address As TAddress, values As RouteValueDictionary, Optional ambientValues 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

Parametri di tipo

TAddress

Tipo di indirizzo.

Parametri

httpContext
HttpContext

Oggetto HttpContext associato alla richiesta corrente.

address
TAddress

Valore dell'indirizzo. Usato per risolvere gli endpoint.

values
RouteValueDictionary

Valori della route. Usato per espandere i parametri nel modello di route.

ambientValues
RouteValueDictionary

Valori associati alla richiesta corrente. Facoltativa.

scheme
String

Schema URI applicato all'URI risultante. Facoltativa. Se non specificato, verrà utilizzato il valore di Scheme .

host
Nullable<HostString>

Host/autorità URI applicato all'URI risultante. Facoltativa. Se non specificato, verrà usato il valore Host . Vedere la sezione osservazioni per informazioni dettagliate sulle implicazioni di sicurezza di host.

pathBase
Nullable<PathString>

Base del percorso URI facoltativo. Anteporre al percorso nell'URI risultante. Se non specificato, verrà utilizzato il valore di PathBase .

fragment
FragmentString

Frammento di URI facoltativo. Aggiunto all'URI risultante.

options
LinkOptions

Oggetto LinkOptions facoltativo. Le impostazioni sull'oggetto specificato eseguono l'override delle impostazioni con nomi corrispondenti da RouteOptions.

Restituisce

URI con un percorso assoluto o null.

Commenti

Il valore di host deve essere un valore attendibile. Basandosi sul valore della richiesta corrente, è possibile consentire all'input non attendibile di influenzare l'URI risultante, a meno che l'intestazione Host non sia stata convalidata. Per istruzioni su come convalidare correttamente l'intestazione nell'ambiente Host di distribuzione, vedere la documentazione sulla distribuzione.

Si applica a