Udostępnij za pośrednictwem


RouteConstraintMatcher.Match Metoda

Definicja

Określa, czy routeValues jest zgodna z podanym constraintsparametrem .

public:
 static bool Match(System::Collections::Generic::IDictionary<System::String ^, Microsoft::AspNetCore::Routing::IRouteConstraint ^> ^ constraints, Microsoft::AspNetCore::Routing::RouteValueDictionary ^ routeValues, Microsoft::AspNetCore::Http::HttpContext ^ httpContext, Microsoft::AspNetCore::Routing::IRouter ^ route, Microsoft::AspNetCore::Routing::RouteDirection routeDirection, Microsoft::Extensions::Logging::ILogger ^ logger);
public static bool Match (System.Collections.Generic.IDictionary<string,Microsoft.AspNetCore.Routing.IRouteConstraint> constraints, Microsoft.AspNetCore.Routing.RouteValueDictionary routeValues, Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Routing.IRouter route, Microsoft.AspNetCore.Routing.RouteDirection routeDirection, Microsoft.Extensions.Logging.ILogger logger);
static member Match : System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.Routing.IRouteConstraint> * Microsoft.AspNetCore.Routing.RouteValueDictionary * Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Routing.IRouter * Microsoft.AspNetCore.Routing.RouteDirection * Microsoft.Extensions.Logging.ILogger -> bool
Public Shared Function Match (constraints As IDictionary(Of String, IRouteConstraint), routeValues As RouteValueDictionary, httpContext As HttpContext, route As IRouter, routeDirection As RouteDirection, logger As ILogger) As Boolean

Parametry

constraints
IDictionary<String,IRouteConstraint>

Ograniczenia trasy.

routeValues
RouteValueDictionary

Wartości parametrów trasy wyodrębnione z dopasowanej trasy.

httpContext
HttpContext

Skojarzone HttpContext z bieżącym żądaniem.

route
IRouter

Router, do którego należy to ograniczenie.

routeDirection
RouteDirection

Wskazuje, czy sprawdzanie ograniczeń jest wykonywane, gdy żądanie przychodzące jest obsługiwane, czy po wygenerowaniu adresu URL.

Zwraca

true jeśli wszystkie wartości trasy są zgodne z ich ograniczeniami.

Dotyczy