Table of Contents

Class StreamOutputFormatter<TFormatter, TOptions>

Namespace
Cuemon.AspNetCore.Mvc.Formatters
Assembly
Cuemon.AspNetCore.Mvc.dll

Provides a way to write an object in a given text format to the output stream with the constraint that TFormatter must be assignable from Formatter<TFormat>. Implements the ConfigurableOutputFormatter<TOptions>

public abstract class StreamOutputFormatter<TFormatter, TOptions> : ConfigurableOutputFormatter<TOptions>, IOutputFormatter, IApiResponseTypeMetadataProvider, IConfigurable<TOptions> where TFormatter : Formatter<Stream> where TOptions : class, IParameterObject, new()

Type Parameters

TFormatter

The type of the Formatter<TFormat>.

TOptions

The type of the configured options.

Inheritance
StreamOutputFormatter<TFormatter, TOptions>
Implements
IConfigurable<TOptions>
Inherited Members

Constructors

StreamOutputFormatter(TOptions)

Initializes a new instance of the StreamOutputFormatter<TFormatter, TOptions> class.

protected StreamOutputFormatter(TOptions options)

Parameters

options TOptions

The TOptions which need to be configured.

Methods

WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

write response body as an asynchronous operation.

public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)

Parameters

context OutputFormatterWriteContext

The formatter context associated with the call.

selectedEncoding Encoding

The Encoding that should be used to write the response.

Returns

Task

A Task which can write the response body.