Dela via


LinkParser.ParsePathByAddress<TAddress>(TAddress, PathString) Method

Definition

Attempts to parse the provided path using the route pattern specified by the Endpoint matching address.

public:
generic <typename TAddress>
 abstract Microsoft::AspNetCore::Routing::RouteValueDictionary ^ ParsePathByAddress(TAddress address, Microsoft::AspNetCore::Http::PathString path);
public abstract Microsoft.AspNetCore.Routing.RouteValueDictionary ParsePathByAddress<TAddress> (TAddress address, Microsoft.AspNetCore.Http.PathString path);
public abstract Microsoft.AspNetCore.Routing.RouteValueDictionary? ParsePathByAddress<TAddress> (TAddress address, Microsoft.AspNetCore.Http.PathString path);
abstract member ParsePathByAddress : 'Address * Microsoft.AspNetCore.Http.PathString -> Microsoft.AspNetCore.Routing.RouteValueDictionary
Public MustOverride Function ParsePathByAddress(Of TAddress) (address As TAddress, path As PathString) As RouteValueDictionary

Type Parameters

TAddress

The address type.

Parameters

address
TAddress

The address value. Used to resolve endpoints.

path
PathString

The URI path to parse.

Returns

A RouteValueDictionary with the parsed values if parsing is successful; otherwise null.

Remarks

ParsePathByAddress<TAddress>(TAddress, PathString) will attempt to first resolve Endpoint instances that match address and then use the route pattern associated with each endpoint to parse the URL path.

The parsing operation will fail and return null if either no endpoints are found or none of the route patterns match the provided URI path.

Applies to