ODataMessageReader.DetectPayloadKindAsync 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 DetectPayloadKindAsync As Task(Of IEnumerable(Of ODataPayloadKindDetectionResult))
'Usage
Dim instance As ODataMessageReader
Dim returnValue As Task(Of IEnumerable(Of ODataPayloadKindDetectionResult))
returnValue = instance.DetectPayloadKindAsync()
public Task<IEnumerable<ODataPayloadKindDetectionResult>> DetectPayloadKindAsync()
public:
Task<IEnumerable<ODataPayloadKindDetectionResult^>^>^ DetectPayloadKindAsync()
member DetectPayloadKindAsync : unit -> Task<IEnumerable<ODataPayloadKindDetectionResult>>
public function DetectPayloadKindAsync() : Task<IEnumerable<ODataPayloadKindDetectionResult>>
Return Value
Type: System.Threading.Tasks.Task<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.