ODataMessageExtensions.GetDataServiceVersion Method (IODataRequestMessage, ODataVersion)

Reads the DataServiceVersion header from the message and parses it. If no DataServiceVersion header is found it sets the default version to be used for reading.

Namespace:  Microsoft.Data.OData
Assembly:  Microsoft.Data.OData (in Microsoft.Data.OData.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetDataServiceVersion ( _
    message As IODataRequestMessage, _
    defaultVersion As ODataVersion _
) As ODataVersion
'Usage
Dim message As IODataRequestMessage 
Dim defaultVersion As ODataVersion 
Dim returnValue As ODataVersion 

returnValue = message.GetDataServiceVersion(defaultVersion)
public static ODataVersion GetDataServiceVersion(
    this IODataRequestMessage message,
    ODataVersion defaultVersion
)
[ExtensionAttribute]
public:
static ODataVersion GetDataServiceVersion(
    IODataRequestMessage^ message, 
    ODataVersion defaultVersion
)
static member GetDataServiceVersion : 
        message:IODataRequestMessage * 
        defaultVersion:ODataVersion -> ODataVersion
public static function GetDataServiceVersion(
    message : IODataRequestMessage, 
    defaultVersion : ODataVersion
) : ODataVersion

Parameters

Return Value

Type: Microsoft.Data.OData.ODataVersion
The ODataVersion object retrieved from the DataServiceVersion header of the message. The default version if none is specified in the header.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IODataRequestMessage. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.113) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.113).

See Also

Reference

ODataMessageExtensions Class

GetDataServiceVersion Overload

Microsoft.Data.OData Namespace