Class ODataVersionConstraint
An implementation of System.Web.Http.Routing.IHttpRouteConstraint that only matches a specific OData protocol version. This constraint won't match any incoming requests that contains either of the v4.0 OData version headers regardless of the version in the current version headers.
public class ODataVersionConstraint : IHttpRouteConstraint
- Inheritance
-
ODataVersionConstraint
- Implements
-
IHttpRouteConstraint
- Inherited Members
Constructors
ODataVersionConstraint()
Creates a new instance of the ODataVersionConstraint class that will have a default version range of 1.0 to 3.0.
public ODataVersionConstraint()
ODataVersionConstraint(ODataVersion)
Creates a new instance of the ODataVersionConstraint class. This instance will match just a single version of the protocol.
public ODataVersionConstraint(ODataVersion version)
Parameters
version
ODataVersionThe version of the protocol that this instance matches.
ODataVersionConstraint(ODataVersion, ODataVersion)
Creates a new instance of the ODataVersionConstraint class. This instance will match just a single version of the protocol.
public ODataVersionConstraint(ODataVersion minVersion, ODataVersion maxVersion)
Parameters
minVersion
ODataVersionThe minimum version of the protocol that this instance matches.
maxVersion
ODataVersionThe maximum version of the protocol that this instance matches.
Properties
MaxVersion
The maximum version of the OData protocol that an OData-Version or OData-MaxVersion request header must have in order to be processed by the OData service with this route constraint.
public ODataVersion MaxVersion { get; }
Property Value
- ODataVersion
MinVersion
The minimum version of the OData protocol that an OData-Version or OData-MaxVersion request header must have in order to be processed by the OData service with this route constraint.
public ODataVersion MinVersion { get; }
Property Value
- ODataVersion
Methods
Match(HttpRequestMessage, IHttpRoute, string, IDictionary<string, object>, HttpRouteDirection)
public bool Match(HttpRequestMessage request, IHttpRoute route, string parameterName, IDictionary<string, object> values, HttpRouteDirection routeDirection)
Parameters
request
HttpRequestMessageroute
IHttpRouteparameterName
stringvalues
IDictionary<string, object>routeDirection
HttpRouteDirection