Share via


ODataMessageExtensions.GetDataServiceVersion Method (IODataResponseMessage, 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 IODataResponseMessage, _
    defaultVersion As ODataVersion _
) As ODataVersion
'Usage
Dim message As IODataResponseMessage 
Dim defaultVersion As ODataVersion 
Dim returnValue As ODataVersion 

returnValue = message.GetDataServiceVersion(defaultVersion)
public static ODataVersion GetDataServiceVersion(
    this IODataResponseMessage message,
    ODataVersion defaultVersion
)
[ExtensionAttribute]
public:
static ODataVersion GetDataServiceVersion(
    IODataResponseMessage^ message, 
    ODataVersion defaultVersion
)
static member GetDataServiceVersion : 
        message:IODataResponseMessage * 
        defaultVersion:ODataVersion -> ODataVersion
public static function GetDataServiceVersion(
    message : IODataResponseMessage, 
    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 IODataResponseMessage. 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