Share via


ODataVersionConstraint Class

 

An implementation of 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.

Namespace:   System.Web.Http.OData.Routing
Assembly:  System.Web.Http.OData (in System.Web.Http.OData.dll)

Inheritance Hierarchy

System.Object
  System.Web.Http.OData.Routing.ODataVersionConstraint

Syntax

public class ODataVersionConstraint : IHttpRouteConstraint
public ref class ODataVersionConstraint : IHttpRouteConstraint
type ODataVersionConstraint = 
    class
        interface IHttpRouteConstraint
    end
Public Class ODataVersionConstraint
    Implements IHttpRouteConstraint

Constructors

Name Description
System_CAPS_pubmethod ODataVersionConstraint()

Creates a new instance of the ODataVersionConstraint class that will have a default version range of 1.0 to 3.0.

System_CAPS_pubmethod ODataVersionConstraint(ODataVersion)

Creates a new instance of the ODataVersionConstraint class. This instance will match just a single version of the protocol.

System_CAPS_pubmethod ODataVersionConstraint(ODataVersion, ODataVersion)

Creates a new instance of the ODataVersionConstraint class. This instance will match just a single version of the protocol.

Properties

Name Description
System_CAPS_pubproperty IsRelaxedMatch

If set to true, allow passing in both OData V1-V3 and next version headers.

System_CAPS_pubproperty 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.

System_CAPS_pubproperty 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.

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod Match(HttpRequestMessage, IHttpRoute, String, IDictionary<String, Object>, HttpRouteDirection)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.Http.OData.Routing Namespace

Return to top