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
TFormatterThe type of the Formatter<TFormat>.
TOptionsThe type of the configured options.
- Inheritance
-
ConfigurableOutputFormatter<TOptions>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
optionsTOptionsThe
TOptionswhich need to be configured.
Methods
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)
write response body as an asynchronous operation.
public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
Parameters
contextOutputFormatterWriteContextThe formatter context associated with the call.
selectedEncodingEncodingThe Encoding that should be used to write the response.