ControllerLinkGeneratorExtensions.GetUriByAction メソッド

定義

オーバーロード

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

指定された値に基づき、絶対 URI を生成します。

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

指定された値に基づき、絶対 URI を生成します。

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

指定された値に基づき、絶対 URI を生成します。

public static string GetUriByAction (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string action, string controller, 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? GetUriByAction (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string action, string controller, 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? GetUriByAction (this Microsoft.AspNetCore.Routing.LinkGenerator generator, string action, string controller, 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 GetUriByAction : Microsoft.AspNetCore.Routing.LinkGenerator * string * string * obj * string * Microsoft.AspNetCore.Http.HostString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.FragmentString * Microsoft.AspNetCore.Routing.LinkOptions -> string
<Extension()>
Public Function GetUriByAction (generator As LinkGenerator, action As String, controller 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

パラメーター

action
String

アクション名。 エンドポイントを解決するために使用されます。

controller
String

コントローラー名。 エンドポイントを解決するために使用されます。

values
Object

ルート値。 null も指定できます。 エンドポイントを解決し、ルート テンプレートのパラメーターを展開するために使用されます。

scheme
String

結果の URI に適用される URI スキーム。

host
HostString

結果の URI に適用される URI ホスト/機関。

pathBase
PathString

省略可能な URI パスベース。 結果の URI のパスの前に付加されます。

fragment
FragmentString

URI フラグメント。 省略可能。 結果の URI に追加されます。

options
LinkOptions

オプションの LinkOptions。 指定されたオブジェクトの設定は、 の RouteOptions一致する名前で設定をオーバーライドします。

戻り値

絶対 URI、または null URI を作成できない場合は 。

注釈

host 値は信頼できる値である必要があります。 現在の要求の値に依存すると、ヘッダーが検証されていない限り、信頼されていない入力が結果の URI に影響を Host 与える可能性があります。 デプロイ環境でヘッダーを適切に検証する方法については、 Host デプロイのドキュメントを参照してください。

適用対象

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

指定された値に基づき、絶対 URI を生成します。

public static string GetUriByAction (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string action = default, string controller = default, object 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);
public static string? GetUriByAction (this Microsoft.AspNetCore.Routing.LinkGenerator generator, Microsoft.AspNetCore.Http.HttpContext httpContext, string? action = default, string? controller = default, object? 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 GetUriByAction : Microsoft.AspNetCore.Routing.LinkGenerator * Microsoft.AspNetCore.Http.HttpContext * string * 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 GetUriByAction (generator As LinkGenerator, httpContext As HttpContext, Optional action As String = Nothing, Optional controller As String = Nothing, Optional values As Object = 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

パラメーター

httpContext
HttpContext

現在の HttpContext 要求に関連付けられている 。

action
String

アクション名。 エンドポイントを解決するために使用されます。 省略可能。 が指定されている場合 null は、現在のアクション ルート値が使用されます。

controller
String

コントローラー名。 エンドポイントを解決するために使用されます。 省略可能。 が指定されている場合 null は、現在のコントローラー ルート値が使用されます。

values
Object

ルート値。 省略可能。 エンドポイントを解決し、ルート テンプレートのパラメーターを展開するために使用されます。

scheme
String

結果の URI に適用される URI スキーム。 省略可能。 指定しない場合は、 の Scheme 値が使用されます。

host
Nullable<HostString>

結果の URI に適用される URI ホスト/機関。 省略可能。 指定しない場合は、値 Host が使用されます。

pathBase
Nullable<PathString>

省略可能な URI パスベース。 結果の URI のパスの前に付加されます。 指定しない場合は、 の PathBase 値が使用されます。

fragment
FragmentString

URI フラグメント。 省略可能。 結果の URI に追加されます。

options
LinkOptions

オプションの LinkOptions。 指定されたオブジェクトの設定は、 の RouteOptions一致する名前で設定をオーバーライドします。

戻り値

絶対 URI、または null URI を作成できない場合は 。

注釈

host 値は信頼できる値である必要があります。 現在の要求の値に依存すると、ヘッダーが検証されていない限り、信頼されていない入力が結果の URI に影響を Host 与える可能性があります。 デプロイ環境でヘッダーを適切に検証する方法については、 Host デプロイのドキュメントを参照してください。

適用対象