LinkGenerator.GetUriByAddress LinkGenerator.GetUriByAddress LinkGenerator.GetUriByAddress Method

Definition

Overloads

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

Generates an absolute URI based on the provided values.

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

Generates an absolute URI based on the provided values and HttpContext.

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

Generates an absolute URI based on the provided values.

public abstract string GetUriByAddress<TAddress> (TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, string scheme, Microsoft.AspNetCore.Http.HostString host, Microsoft.AspNetCore.Http.PathString pathBase = null, Microsoft.AspNetCore.Http.FragmentString fragment = null, Microsoft.AspNetCore.Routing.LinkOptions options = null);
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 = null, Optional fragment As FragmentString = null, Optional options As LinkOptions = null) As String

Type Parameters

TAddress

The address type.

Parameters

address

The address value. Used to resolve endpoints.

values
RouteValueDictionary RouteValueDictionary RouteValueDictionary

The route values. Used to expand parameters in the route template. Optional.

scheme
String String String

The URI scheme, applied to the resulting URI.

host
HostString HostString HostString

The URI host/authority, applied to the resulting URI. See the remarks section for details about the security implications of the host.

pathBase
PathString PathString PathString

An optional URI path base. Prepended to the path in the resulting URI.

fragment
FragmentString FragmentString FragmentString

An optional URI fragment. Appended to the resulting URI.

options
LinkOptions LinkOptions LinkOptions

An optional LinkOptions. Settings on provided object override the settings with matching names from RouteOptions.

Returns

An absolute URI, or null.

Remarks

The value of host should be a trusted value. Relying on the value of the current request can allow untrusted input to influence the resulting URI unless the Host header has been validated. See the deployment documentation for instructions on how to properly validate the Host header in your deployment environment.

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

Generates an absolute URI based on the provided values and HttpContext.

public abstract string GetUriByAddress<TAddress> (Microsoft.AspNetCore.Http.HttpContext httpContext, TAddress address, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Routing.RouteValueDictionary ambientValues = null, string scheme = null, Nullable<Microsoft.AspNetCore.Http.HostString> host = null, Nullable<Microsoft.AspNetCore.Http.PathString> pathBase = null, Microsoft.AspNetCore.Http.FragmentString fragment = null, Microsoft.AspNetCore.Routing.LinkOptions options = null);
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

Type Parameters

TAddress

The address type.

Parameters

httpContext
HttpContext HttpContext HttpContext

The HttpContext associated with the current request.

address

The address value. Used to resolve endpoints.

values
RouteValueDictionary RouteValueDictionary RouteValueDictionary

The route values. Used to expand parameters in the route template. Optional.

ambientValues
RouteValueDictionary RouteValueDictionary RouteValueDictionary

The values associated with the current request. Optional.

scheme
String String String

The URI scheme, applied to the resulting URI. Optional. If not provided, the value of Scheme will be used.

host
Nullable<HostString>

The URI host/authority, applied to the resulting URI. Optional. If not provided, the value Host will be used. See the remarks section for details about the security implications of the host.

pathBase
Nullable<PathString>

An optional URI path base. Prepended to the path in the resulting URI. If not provided, the value of PathBase will be used.

fragment
FragmentString FragmentString FragmentString

An optional URI fragment. Appended to the resulting URI.

options
LinkOptions LinkOptions LinkOptions

An optional LinkOptions. Settings on provided object override the settings with matching names from RouteOptions.

Returns

A URI with an absolute path, or null.

Remarks

The value of host should be a trusted value. Relying on the value of the current request can allow untrusted input to influence the resulting URI unless the Host header has been validated. See the deployment documentation for instructions on how to properly validate the Host header in your deployment environment.

Applies to