XmlSerializerInputFormatter 类

定义

此类使用 将输入 XML 数据反序列化为强类型对象 XmlSerializer

public ref class XmlSerializerInputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextInputFormatter
public ref class XmlSerializerInputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextInputFormatter, Microsoft::AspNetCore::Mvc::Formatters::IInputFormatterExceptionPolicy
public class XmlSerializerInputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextInputFormatter
public class XmlSerializerInputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextInputFormatter, Microsoft.AspNetCore.Mvc.Formatters.IInputFormatterExceptionPolicy
type XmlSerializerInputFormatter = class
    inherit TextInputFormatter
type XmlSerializerInputFormatter = class
    inherit TextInputFormatter
    interface IInputFormatterExceptionPolicy
Public Class XmlSerializerInputFormatter
Inherits TextInputFormatter
Public Class XmlSerializerInputFormatter
Inherits TextInputFormatter
Implements IInputFormatterExceptionPolicy
继承
XmlSerializerInputFormatter
实现

构造函数

XmlSerializerInputFormatter()
已过时.

初始化 XmlSerializerInputFormatter 的新实例。

XmlSerializerInputFormatter(Boolean)
已过时.

初始化 XmlSerializerInputFormatter 的新实例。

XmlSerializerInputFormatter(MvcOptions)

初始化 XmlSerializerInputFormatter 的新实例。

属性

ExceptionPolicy

获取标志,以指示正文模型绑定器是否应处理所有异常。 如果处理异常,则正文模型绑定器会将异常转换为模型状态错误,否则允许该异常传播。

MaxDepth

指示可接受的输入 XML 深度。

SupportedEncodings

获取此 TextInputFormatter支持的字符编码的可变集合。 读取数据时使用编码。

(继承自 TextInputFormatter)
SupportedMediaTypes

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

(继承自 InputFormatter)
WrapperProviderFactories

获取 的列表 IWrapperProviderFactory ,以提供用于反序列化的包装类型。

XmlDictionaryReaderQuotas

配额包括 - DefaultMaxDepth、DefaultMaxStringContentLength、DefaultMaxArrayLength、DefaultMaxBytesPerRead、DefaultMaxNameTableCharCount

方法

CanRead(InputFormatterContext)

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

(继承自 InputFormatter)
CanReadType(Type)

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

CreateSerializer(Type)

在反序列化期间调用 以获取 XmlSerializer

CreateXmlReader(Stream, Encoding)

在反序列化期间调用 以获取 XmlReader

CreateXmlReader(Stream, Encoding, Type)

在反序列化期间调用 以获取 XmlReader

GetCachedSerializer(Type)

获取缓存的序列化程序,或创建并缓存给定类型的序列化程序。

GetDefaultValueForType(Type)

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

(继承自 InputFormatter)
GetSerializableType(Type)

获取 XML 将反序列化到的类型。

GetSupportedContentTypes(String, Type)

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

(继承自 InputFormatter)
ReadAsync(InputFormatterContext)

从请求正文中读取对象。

(继承自 InputFormatter)
ReadRequestBodyAsync(InputFormatterContext)

从请求正文中读取对象。

(继承自 TextInputFormatter)
ReadRequestBodyAsync(InputFormatterContext, Encoding)

从请求正文中读取对象。

SelectCharacterEncoding(InputFormatterContext)

返回 Encoding 基于 context的字符集的 。

(继承自 TextInputFormatter)

适用于