Bagikan melalui


IRouteConstraint.Match Metode

Definisi

Menentukan apakah parameter URL berisi nilai yang valid untuk batasan ini.

public:
 bool Match(Microsoft::AspNetCore::Http::HttpContext ^ httpContext, Microsoft::AspNetCore::Routing::IRouter ^ route, System::String ^ routeKey, Microsoft::AspNetCore::Routing::RouteValueDictionary ^ values, Microsoft::AspNetCore::Routing::RouteDirection routeDirection);
public bool Match (Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Routing.IRouter route, string routeKey, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Routing.RouteDirection routeDirection);
public bool Match (Microsoft.AspNetCore.Http.HttpContext? httpContext, Microsoft.AspNetCore.Routing.IRouter? route, string routeKey, Microsoft.AspNetCore.Routing.RouteValueDictionary values, Microsoft.AspNetCore.Routing.RouteDirection routeDirection);
abstract member Match : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Routing.IRouter * string * Microsoft.AspNetCore.Routing.RouteValueDictionary * Microsoft.AspNetCore.Routing.RouteDirection -> bool
Public Function Match (httpContext As HttpContext, route As IRouter, routeKey As String, values As RouteValueDictionary, routeDirection As RouteDirection) As Boolean

Parameter

httpContext
HttpContext

Objek yang merangkum informasi tentang permintaan HTTP.

route
IRouter

Router milik batasan ini.

routeKey
String

Nama parameter yang sedang diperiksa.

values
RouteValueDictionary

Kamus yang berisi parameter untuk URL.

routeDirection
RouteDirection

Objek yang menunjukkan apakah pemeriksaan batasan sedang dilakukan saat permintaan masuk sedang ditangani atau saat URL dibuat.

Mengembalikan

true jika parameter URL berisi nilai yang valid; jika tidak, false.

Berlaku untuk