语言

InputFormatter 类

定义

从请求正文中读取 对象。

public ref class InputFormatter abstract : Microsoft::AspNetCore::Mvc::ApiExplorer::IApiRequestFormatMetadataProvider, Microsoft::AspNetCore::Mvc::Formatters::IInputFormatter
public abstract class InputFormatter : Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestFormatMetadataProvider, Microsoft.AspNetCore.Mvc.Formatters.IInputFormatter
type InputFormatter = class
    interface IInputFormatter
    interface IApiRequestFormatMetadataProvider
type InputFormatter = class
    interface IApiRequestFormatMetadataProvider
    interface IInputFormatter
Public MustInherit Class InputFormatter
Implements IApiRequestFormatMetadataProvider, IInputFormatter
继承
InputFormatter
派生
实现

构造函数

名称 说明
InputFormatter()

从请求正文中读取 对象。

属性

名称 说明
SupportedMediaTypes

获取此 InputFormatter支持的媒体类型元素的可变集合。

方法

名称 说明
CanRead(InputFormatterContext)

确定这IInputFormatter是否可以反序列化 的 ModelType对象context

CanReadType(Type)

确定这 InputFormatter 是否可以反序列化给定 type的 对象。

GetDefaultValueForType(Type)

获取给定类型的默认值。 用于在正文不包含任何内容时返回默认值。

GetSupportedContentTypes(String, Type)

获取 和 contentType支持的内容类型IInputFormatterobjectType的筛选列表。

ReadAsync(InputFormatterContext)

从请求正文中读取 对象。

ReadRequestBodyAsync(InputFormatterContext)

从请求正文中读取 对象。

适用于