Delen via


LinkGeneratorRouteValuesAddressExtensions.GetUriByRouteValues Method

Definition

Overloads

GetUriByRouteValues(LinkGenerator, String, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions)

Generates an absolute URI based on the provided values.

GetUriByRouteValues(LinkGenerator, String, Object, String, HostString, PathString, FragmentString, LinkOptions)

Generates an absolute URI based on the provided values.

GetUriByRouteValues(LinkGenerator, HttpContext, String, RouteValueDictionary, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

Generates an absolute URI based on the provided values.

GetUriByRouteValues(LinkGenerator, HttpContext, String, Object, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

Generates an absolute URI based on the provided values.

GetUriByRouteValues(LinkGenerator, String, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions)

Source:
LinkGeneratorRouteValuesAddressExtensions.cs

Generates an absolute URI based on the provided values.

public static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string? routeName, 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);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * string * Microsoft.AspNetCore.Routing.RouteValueDictionary * string * Microsoft.AspNetCore.Http.HostString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, routeName As String, 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

Parameters

generator
LinkGenerator

The LinkGenerator.

routeName
String

The route name. Used to resolve endpoints. Optional.

values
RouteValueDictionary

The route values. Used to resolve endpoints and expand parameters in the route template.

scheme
String

The URI scheme, applied to the resulting URI.

host
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

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

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.

Applies to

GetUriByRouteValues(LinkGenerator, String, Object, String, HostString, PathString, FragmentString, LinkOptions)

Source:
LinkGeneratorRouteValuesAddressExtensions.cs
Source:
LinkGeneratorRouteValuesAddressExtensions.cs

Generates an absolute URI based on the provided values.

public static string GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string routeName, object 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 static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string? routeName, object? 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);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * string * obj * string * Microsoft.AspNetCore.Http.HostString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, routeName As String, values As Object, scheme As String, host As HostString, Optional pathBase As PathString = Nothing, Optional fragment As FragmentString = Nothing, Optional options As LinkOptions = Nothing) As String

Parameters

generator
LinkGenerator

The LinkGenerator.

routeName
String

The route name. Used to resolve endpoints. Optional.

values
Object

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

scheme
String

The URI scheme, applied to the resulting URI.

host
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

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

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.

Applies to

GetUriByRouteValues(LinkGenerator, HttpContext, String, RouteValueDictionary, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

Source:
LinkGeneratorRouteValuesAddressExtensions.cs

Generates an absolute URI based on the provided values.

public static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string? routeName, Microsoft.AspNetCore.Routing.RouteValueDictionary? values = 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);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * Microsoft.AspNetCore.Http.HttpContext * string * Microsoft.AspNetCore.Routing.RouteValueDictionary * string * Nullable<Microsoft.AspNetCore.Http.HostString> * Nullable<Microsoft.AspNetCore.Http.PathString> * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, httpContext As HttpContext, routeName As String, Optional values 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

Parameters

generator
LinkGenerator

The LinkGenerator.

httpContext
HttpContext

The HttpContext associated with the current request.

routeName
String

The route name. Used to resolve endpoints. Optional.

values
RouteValueDictionary

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

scheme
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

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.

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

GetUriByRouteValues(LinkGenerator, HttpContext, String, Object, String, Nullable<HostString>, Nullable<PathString>, FragmentString, LinkOptions)

Source:
LinkGeneratorRouteValuesAddressExtensions.cs
Source:
LinkGeneratorRouteValuesAddressExtensions.cs

Generates an absolute URI based on the provided values.

public static string GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string routeName, object values, 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 static string? GetUriByRouteValues (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string? routeName, object? values, 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);
static member GetUriByRouteValues : Microsoft.AspNetCore.Routing.LinkGenerator * Microsoft.AspNetCore.Http.HttpContext * string * obj * string * Nullable<Microsoft.AspNetCore.Http.HostString> * Nullable<Microsoft.AspNetCore.Http.PathString> * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByRouteValues (generator As LinkGenerator, httpContext As HttpContext, routeName As String, values As Object, 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

Parameters

generator
LinkGenerator

The LinkGenerator.

httpContext
HttpContext

The HttpContext associated with the current request.

routeName
String

The route name. Used to resolve endpoints. Optional.

values
Object

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

scheme
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

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.

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