/// <summary> /// Detects the payload kind(s) from the message stream. /// </summary> /// <param name="messageStream">The message stream to read from for payload kind detection.</param> /// <param name="readingResponse">true if reading a response message; otherwise false.</param> /// <param name="synchronous">true if the input should be read synchronously; false if it should be read asynchronously.</param> /// <param name="detectionInfo">Additional information available for the payload kind detection.</param> /// <returns>An enumerable of zero or more payload kinds depending on what payload kinds were detected.</returns> private IEnumerable <ODataPayloadKind> DetectPayloadKindImplementation( Stream messageStream, bool readingResponse, bool synchronous, ODataPayloadKindDetectionInfo detectionInfo) { using (ODataAtomInputContext inputContext = new ODataAtomInputContext( this, messageStream, detectionInfo.GetEncoding(), detectionInfo.MessageReaderSettings, readingResponse, synchronous, detectionInfo.Model, /*urlResolver*/ null)) { return(inputContext.DetectPayloadKind(detectionInfo)); } }
/// <summary> /// Detects the payload kind(s) from the message stream. /// </summary> /// <param name="messageStream">The message stream to read from for payload kind detection.</param> /// <param name="readingResponse">true if reading a response message; otherwise false.</param> /// <param name="synchronous">true if the input should be read synchronously; false if it should be read asynchronously.</param> /// <param name="detectionInfo">Additional information available for the payload kind detection.</param> /// <returns>An enumerable of zero or more payload kinds depending on what payload kinds were detected.</returns> private IEnumerable <ODataPayloadKind> DetectPayloadKindImplementation( Stream messageStream, bool readingResponse, bool synchronous, ODataPayloadKindDetectionInfo detectionInfo) { using (ODataAtomInputContext inputContext = new ODataAtomInputContext( this, messageStream, detectionInfo.GetEncoding(), detectionInfo.MessageReaderSettings, ODataVersion.V4, // NOTE: we don't rely on the version for payload kind detection; taking the latest. readingResponse, synchronous, detectionInfo.Model, /*urlResolver*/ null)) { return(inputContext.DetectPayloadKind(detectionInfo)); } }
/// <summary> /// Detects the payload kind(s) from the message stream. /// </summary> /// <param name="messageStream">The message stream to read from for payload kind detection.</param> /// <param name="readingResponse">true if reading a response message; otherwise false.</param> /// <param name="synchronous">true if the input should be read synchronously; false if it should be read asynchronously.</param> /// <param name="detectionInfo">Additional information available for the payload kind detection.</param> /// <returns>An enumerable of zero or more payload kinds depending on what payload kinds were detected.</returns> private IEnumerable<ODataPayloadKind> DetectPayloadKindImplementation( Stream messageStream, bool readingResponse, bool synchronous, ODataPayloadKindDetectionInfo detectionInfo) { using (ODataAtomInputContext inputContext = new ODataAtomInputContext( this, messageStream, detectionInfo.GetEncoding(), detectionInfo.MessageReaderSettings, readingResponse, synchronous, detectionInfo.Model, /*urlResolver*/ null)) { return inputContext.DetectPayloadKind(detectionInfo); } }