Table of Contents

Class StreamInputFormatter<TFormatter, TOptions>

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

Provides a way to read an object from a request body with a text format with the constraint that TFormatter must be assignable from Formatter<TFormat>. Implements the ConfigurableInputFormatter<TOptions>

public abstract class StreamInputFormatter<TFormatter, TOptions> : ConfigurableInputFormatter<TOptions>, IInputFormatter, IApiRequestFormatMetadataProvider, 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
StreamInputFormatter<TFormatter, TOptions>
Implements
IConfigurable<TOptions>
Inherited Members

Constructors

StreamInputFormatter(TOptions)

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

protected StreamInputFormatter(TOptions options)

Parameters

options TOptions

The TOptions which need to be configured.

Methods

ReadRequestBodyAsync(InputFormatterContext, Encoding)

Reads an object from the request body.

public override Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)

Parameters

context InputFormatterContext

The InputFormatterContext.

encoding Encoding

The Encoding used to read the request body.

Returns

Task<InputFormatterResult>

A Task that on completion deserializes the request body.

Remarks

In this implementation encoding is disregarded.