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
Object
OutputFormatter
TextOutputFormatter
StreamOutputFormatter<TFormatter, TOptions>
Implements
IOutputFormatter
IApiResponseTypeMetadataProvider
IConfigurable<TOptions>
Derived
Inherited Members
TextOutputFormatter.SelectCharacterEncoding(OutputFormatterWriteContext)
TextOutputFormatter.WriteAsync(OutputFormatterWriteContext)
TextOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext)
TextOutputFormatter.SupportedEncodings
OutputFormatter.CanWriteType(Type)
OutputFormatter.GetSupportedContentTypes(String, Type)
OutputFormatter.CanWriteResult(OutputFormatterCanWriteContext)
OutputFormatter.WriteResponseHeaders(OutputFormatterWriteContext)
OutputFormatter.SupportedMediaTypes

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 async Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)

Parameters

context OutputFormatterWriteContext

The formatter context associated with the call.

selectedEncoding Encoding

The System.Text.Encoding that should be used to write the response.

Returns

Task

A System.Threading.Tasks.Task which can write the response body.