GuidRouteConstraint Class

Constrains a route parameter to represent only System.Guid values. Matches values specified in any of the five formats “N”, “D”, “B”, “P”, or “X”, supported by Guid.ToString(string) and Guid.ToString(String, IFormatProvider) methods.

Namespace
Microsoft.AspNetCore.Routing.Constraints
Assemblies
  • Microsoft.AspNetCore.Routing

Syntax

public class GuidRouteConstraint : IRouteConstraint
class Microsoft.AspNetCore.Routing.Constraints.GuidRouteConstraint

Methods

Match(Microsoft.AspNetCore.Http.HttpContext, Microsoft.AspNetCore.Routing.IRouter, System.String, Microsoft.AspNetCore.Routing.RouteValueDictionary, Microsoft.AspNetCore.Routing.RouteDirection)
Return type:System.Boolean
public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)