Freigeben über


MediaTypeFormatter.ReadFromStreamAsync Method

 

Namespace:   System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Overload List

Name Description
System_CAPS_pubmethod ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger)

Asynchronously deserializes an object of the specified type.

System_CAPS_pubmethod ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger, CancellationToken)

Asynchronously deserializes an object of the specified type.

See Also

MediaTypeFormatter Class
System.Net.Http.Formatting Namespace

Return to top

MediaTypeFormatter.ReadFromStreamAsync Method (Type, Stream, HttpContent, IFormatterLogger)

Asynchronously deserializes an object of the specified type.

Syntax

public virtual Task<object> ReadFromStreamAsync(
    Type type,
    Stream readStream,
    HttpContent content,
    IFormatterLogger formatterLogger
)
public:
virtual Task<Object^>^ ReadFromStreamAsync(
    Type^ type,
    Stream^ readStream,
    HttpContent^ content,
    IFormatterLogger^ formatterLogger
)
abstract ReadFromStreamAsync : 
        type:Type *
        readStream:Stream *
        content:HttpContent *
        formatterLogger:IFormatterLogger -> Task<Object>
override ReadFromStreamAsync : 
        type:Type *
        readStream:Stream *
        content:HttpContent *
        formatterLogger:IFormatterLogger -> Task<Object>
Public Overridable Function ReadFromStreamAsync (
    type As Type,
    readStream As Stream,
    content As HttpContent,
    formatterLogger As IFormatterLogger
) As Task(Of Object)

Parameters

  • type
    Type: System.Type

    The type of the object to deserialize.

Return Value

Type: System.Threading.Tasks.Task<Object>

A Task whose result will be an object of the given type.

Exceptions

Exception Condition
NotSupportedException

Derived types need to support reading.

Return to top

MediaTypeFormatter.ReadFromStreamAsync Method (Type, Stream, HttpContent, IFormatterLogger, CancellationToken)

Asynchronously deserializes an object of the specified type.

Syntax

public virtual Task<object> ReadFromStreamAsync(
    Type type,
    Stream readStream,
    HttpContent content,
    IFormatterLogger formatterLogger,
    CancellationToken cancellationToken
)
public:
virtual Task<Object^>^ ReadFromStreamAsync(
    Type^ type,
    Stream^ readStream,
    HttpContent^ content,
    IFormatterLogger^ formatterLogger,
    CancellationToken cancellationToken
)
abstract ReadFromStreamAsync : 
        type:Type *
        readStream:Stream *
        content:HttpContent *
        formatterLogger:IFormatterLogger *
        cancellationToken:CancellationToken -> Task<Object>
override ReadFromStreamAsync : 
        type:Type *
        readStream:Stream *
        content:HttpContent *
        formatterLogger:IFormatterLogger *
        cancellationToken:CancellationToken -> Task<Object>
Public Overridable Function ReadFromStreamAsync (
    type As Type,
    readStream As Stream,
    content As HttpContent,
    formatterLogger As IFormatterLogger,
    cancellationToken As CancellationToken
) As Task(Of Object)

Parameters

  • type
    Type: System.Type

    The type of the object to deserialize.

Return Value

Type: System.Threading.Tasks.Task<Object>

A Task whose result will be an object of the given type.

Return to top