Share via


ODataMessageReader.DetectPayloadKind Method

Determines the potential payload kinds and formats of the payload being read and returns it.

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

Syntax

'Declaration
Public Function DetectPayloadKind As IEnumerable(Of ODataPayloadKindDetectionResult)
'Usage
Dim instance As ODataMessageReader 
Dim returnValue As IEnumerable(Of ODataPayloadKindDetectionResult)

returnValue = instance.DetectPayloadKind()
public IEnumerable<ODataPayloadKindDetectionResult> DetectPayloadKind()
public:
IEnumerable<ODataPayloadKindDetectionResult^>^ DetectPayloadKind()
member DetectPayloadKind : unit -> IEnumerable<ODataPayloadKindDetectionResult> 
public function DetectPayloadKind() : IEnumerable<ODataPayloadKindDetectionResult>

Return Value

Type: System.Collections.Generic.IEnumerable<ODataPayloadKindDetectionResult>
The set of potential payload kinds and formats for the payload being read by this reader.

Remarks

When this method is called it first analyzes the content type and determines whether there are multiple matching payload kinds registered for the message's content type. If there are, it then runs the payload kind detection on all formats that have a matching payload kind registered. Note that this method can return multiple results if a payload is valid for multiple payload kinds but will always at most return a single result per payload kind.

See Also

Reference

ODataMessageReader Class

Microsoft.Data.OData Namespace