Share via


ODataMessageReader.DetectPayloadKindAsync Method

Definition

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

public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.ODataPayloadKindDetectionResult>> DetectPayloadKindAsync ();
member this.DetectPayloadKindAsync : unit -> System.Threading.Tasks.Task<seq<Microsoft.OData.ODataPayloadKindDetectionResult>>
Public Function DetectPayloadKindAsync () As Task(Of IEnumerable(Of ODataPayloadKindDetectionResult))

Returns

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.

Applies to