Dela via


LinkGenerator.GetPathByAddress Method

Definition

Overloads

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

Generates a URI with an absolute path based on the provided values.

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

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

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

Source:
LinkGenerator.cs

Generates a URI with an absolute path based on the provided values.

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

Type Parameters

TAddress

The address type.

Parameters

address
TAddress

The address value. Used to resolve endpoints.

values
RouteValueDictionary

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

pathBase
PathString

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

fragment
FragmentString

An optional URI fragment. Appended to the resulting URI.

options
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.

Applies to

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

Source:
LinkGenerator.cs

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

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

Type Parameters

TAddress

The address type.

Parameters

httpContext
HttpContext

The HttpContext associated with the current request.

address
TAddress

The address value. Used to resolve endpoints.

values
RouteValueDictionary

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

ambientValues
RouteValueDictionary

The values associated with the current request. Optional.

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

An optional URI fragment. Appended to the resulting URI.

options
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.

Applies to