MediaTypeFormatter.OnWriteToStreamAsync Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Called to write an object to the stream asynchronously.
Namespace: System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Protected Overridable Function OnWriteToStreamAsync ( _
type As Type, _
value As Object, _
stream As Stream, _
contentHeaders As HttpContentHeaders, _
formatterContext As FormatterContext, _
transportContext As TransportContext _
) As Task
protected virtual Task OnWriteToStreamAsync(
Type type,
Object value,
Stream stream,
HttpContentHeaders contentHeaders,
FormatterContext formatterContext,
TransportContext transportContext
)
protected:
virtual Task^ OnWriteToStreamAsync(
Type^ type,
Object^ value,
Stream^ stream,
HttpContentHeaders^ contentHeaders,
FormatterContext^ formatterContext,
TransportContext^ transportContext
)
abstract OnWriteToStreamAsync :
type:Type *
value:Object *
stream:Stream *
contentHeaders:HttpContentHeaders *
formatterContext:FormatterContext *
transportContext:TransportContext -> Task
override OnWriteToStreamAsync :
type:Type *
value:Object *
stream:Stream *
contentHeaders:HttpContentHeaders *
formatterContext:FormatterContext *
transportContext:TransportContext -> Task
protected function OnWriteToStreamAsync(
type : Type,
value : Object,
stream : Stream,
contentHeaders : HttpContentHeaders,
formatterContext : FormatterContext,
transportContext : TransportContext
) : Task
Parameters
- type
Type: System.Type
The type of object to write.
- value
Type: System.Object
The object instance to write.
- stream
Type: System.IO.Stream
The Stream to which to write.
- contentHeaders
Type: System.Net.Http.Headers.HttpContentHeaders
The HttpContentHeaders for the content being written.
- formatterContext
Type: System.Net.Http.Formatting.FormatterContext
The FormatterContext containing the respective request or response.
- transportContext
Type: System.Net.TransportContext
The TransportContext.
Return Value
Type: System.Threading.Tasks.Task
A Task that will write the object to the stream asynchronously.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.