Share via


InputFormatterContext Class

Definition

A context object used by an input formatter for deserializing the request body into an object.

public ref class InputFormatterContext
public class InputFormatterContext
type InputFormatterContext = class
Public Class InputFormatterContext
Inheritance
InputFormatterContext

Constructors

InputFormatterContext(HttpContext, String, ModelStateDictionary, ModelMetadata, Func<Stream,Encoding,TextReader>, Boolean)

Creates a new instance of InputFormatterContext.

InputFormatterContext(HttpContext, String, ModelStateDictionary, ModelMetadata, Func<Stream,Encoding,TextReader>)

Creates a new instance of InputFormatterContext.

Properties

HttpContext

Gets the HttpContext associated with the current operation.

Metadata

Gets the requested ModelMetadata of the request body deserialization.

ModelName

Gets the name of the model. Used as the key or key prefix for errors added to ModelState.

ModelState

Gets the ModelStateDictionary associated with the current operation.

ModelType

Gets the requested Type of the request body deserialization.

ReaderFactory

Gets a delegate which can create a TextReader for the request body.

TreatEmptyInputAsDefaultValue

Gets a flag to indicate whether the input formatter should allow no value to be provided. If false, the input formatter should handle empty input by returning NoValueAsync(). If true, the input formatter should handle empty input by returning the default value for the type ModelType.

Applies to