BaseJsonMediaTypeFormatter.WriteToStreamAsync Method (Type, Object, Stream, HttpContent, TransportContext, CancellationToken)

Called during serialization to write an object of the specified type to the specified stream.

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

Syntax

'Declaration
Public Overrides Function WriteToStreamAsync ( _
    type As Type, _
    value As Object, _
    writeStream As Stream, _
    content As HttpContent, _
    transportContext As TransportContext, _
    cancellationToken As CancellationToken _
) As Task
'Usage
Dim instance As BaseJsonMediaTypeFormatter 
Dim type As Type 
Dim value As Object 
Dim writeStream As Stream 
Dim content As HttpContent 
Dim transportContext As TransportContext 
Dim cancellationToken As CancellationToken 
Dim returnValue As Task 

returnValue = instance.WriteToStreamAsync(type, _
    value, writeStream, content, transportContext, _
    cancellationToken)
public override Task WriteToStreamAsync(
    Type type,
    Object value,
    Stream writeStream,
    HttpContent content,
    TransportContext transportContext,
    CancellationToken cancellationToken
)
public:
virtual Task^ WriteToStreamAsync(
    Type^ type, 
    Object^ value, 
    Stream^ writeStream, 
    HttpContent^ content, 
    TransportContext^ transportContext, 
    CancellationToken cancellationToken
) override
abstract WriteToStreamAsync : 
        type:Type * 
        value:Object * 
        writeStream:Stream * 
        content:HttpContent * 
        transportContext:TransportContext * 
        cancellationToken:CancellationToken -> Task  
override WriteToStreamAsync : 
        type:Type * 
        value:Object * 
        writeStream:Stream * 
        content:HttpContent * 
        transportContext:TransportContext * 
        cancellationToken:CancellationToken -> Task
public override function WriteToStreamAsync(
    type : Type, 
    value : Object, 
    writeStream : Stream, 
    content : HttpContent, 
    transportContext : TransportContext, 
    cancellationToken : CancellationToken
) : Task

Parameters

  • type
    Type: System.Type
    The type of the object to write.
  • content
    Type: HttpContent
    The HttpContent for the content being written.

Return Value

Type: System.Threading.Tasks.Task
Returns Task.

See Also

Reference

BaseJsonMediaTypeFormatter Class

WriteToStreamAsync Overload

System.Net.Http.Formatting Namespace