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
TFormatterThe type of the Formatter<TFormat>.
TOptionsThe type of the configured options.
- Inheritance
-
ConfigurableInputFormatter<TOptions>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
optionsTOptionsThe
TOptionswhich 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
contextInputFormatterContextencodingEncodingThe 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.