C# Class Framework.Mvc.Routing.HttpVerbConstraint

Allows you to define which HTTP verbs are permitted when determining whether an HTTP request matches a route. This implementation supports both native HTTP verbs and the X-HTTP-Method-Override hidden element submitted as part of an HTTP POST.
Inheritance: IRouteConstraint
Mostra file Open project: coreframework/Core-Framework

Public Methods

Method Description
HttpVerbConstraint ( HttpVerbs routeVerbs ) : System

Initializes a new instance of the HttpVerbConstraint class.

Match ( System.Web.HttpContextBase httpContext, Route route, String parameterName, RouteValueDictionary values, RouteDirection routeDirection ) : bool

Determines whether the URL parameter contains a valid value for this constraint.

Method Details

HttpVerbConstraint() public method

Initializes a new instance of the HttpVerbConstraint class.
public HttpVerbConstraint ( HttpVerbs routeVerbs ) : System
routeVerbs HttpVerbs The route verbs.
return System

Match() public method

Determines whether the URL parameter contains a valid value for this constraint.
public Match ( System.Web.HttpContextBase httpContext, Route route, String parameterName, RouteValueDictionary values, RouteDirection routeDirection ) : bool
httpContext System.Web.HttpContextBase An object that encapsulates information about the HTTP request.
route System.Web.Routing.Route The object that this constraint belongs to.
parameterName String The name of the parameter that is being checked.
values RouteValueDictionary An object that contains the parameters for the URL.
routeDirection RouteDirection An object that indicates whether the constraint check is being performed when an incoming request is being handled or when a URL is being generated.
return bool