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
Object
InputFormatter
TextInputFormatter
StreamInputFormatter<TFormatter, TOptions>
Implements
IInputFormatter
IApiRequestFormatMetadataProvider
IConfigurable<TOptions>
Derived
Inherited Members
TextInputFormatter.UTF8EncodingWithoutBOM
TextInputFormatter.UTF16EncodingLittleEndian
TextInputFormatter.ReadRequestBodyAsync(InputFormatterContext)
TextInputFormatter.SelectCharacterEncoding(InputFormatterContext)
TextInputFormatter.SupportedEncodings
InputFormatter.GetDefaultValueForType(Type)
InputFormatter.CanRead(InputFormatterContext)
InputFormatter.CanReadType(Type)
InputFormatter.ReadAsync(InputFormatterContext)
InputFormatter.GetSupportedContentTypes(String, Type)
InputFormatter.SupportedMediaTypes

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 async Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)

Parameters

context InputFormatterContext

The Microsoft.AspNetCore.Mvc.Formatters.InputFormatterContext.

encoding Encoding

The System.Text.Encoding used to read the request body.

Returns

Task<InputFormatterResult>

A System.Threading.Tasks.Task that on completion deserializes the request body.

Remarks

In this implementation encoding is disregarded.