XmlSerializerOutputFormatter 類別

定義

這個類別會使用 處理物件到 XML 的序列化 XmlSerializer

public ref class XmlSerializerOutputFormatter : Microsoft::AspNetCore::Mvc::Formatters::TextOutputFormatter
public class XmlSerializerOutputFormatter : Microsoft.AspNetCore.Mvc.Formatters.TextOutputFormatter
type XmlSerializerOutputFormatter = class
    inherit TextOutputFormatter
Public Class XmlSerializerOutputFormatter
Inherits TextOutputFormatter
繼承
XmlSerializerOutputFormatter

建構函式

XmlSerializerOutputFormatter()

使用預設 XmlWriterSettings 初始化 XmlSerializerOutputFormatter 的新實例。

XmlSerializerOutputFormatter(ILoggerFactory)

使用預設 XmlWriterSettings 初始化 XmlSerializerOutputFormatter 的新實例。

XmlSerializerOutputFormatter(XmlWriterSettings)

初始化 XmlSerializerOutputFormatter 的新執行個體。

XmlSerializerOutputFormatter(XmlWriterSettings, ILoggerFactory)

初始化 XmlSerializerOutputFormatter 的新執行個體

屬性

SupportedEncodings

取得這個 TextOutputFormatter 支援的可變動字元編碼集合。 寫入資料時會使用編碼。

(繼承來源 TextOutputFormatter)
SupportedMediaTypes

取得這個 OutputFormatter 所支援的可變動媒體類型專案集合。

(繼承來源 OutputFormatter)
WrapperProviderFactories

取得 的清單 IWrapperProviderFactory ,以提供序列化的包裝類型。

WriterSettings

取得 XmlWriter 要使用的設定。

方法

CanWriteResult(OutputFormatterCanWriteContext)

判斷這 IOutputFormatter 是否可以序列化指定型別的物件。

(繼承來源 OutputFormatter)
CanWriteType(Type)

傳回值,指出這個序列化程式是否可以寫入指定的型別。

CreateSerializer(Type)

為指定的物件類型建立 的新實例 XmlSerializer

CreateXmlWriter(OutputFormatterWriteContext, TextWriter, XmlWriterSettings)

使用指定的 TextWriterXmlWriterSettings ,建立 的新實例 XmlWriter

CreateXmlWriter(TextWriter, XmlWriterSettings)

使用指定的 TextWriterXmlWriterSettings ,建立 的新實例 XmlWriter

GetCachedSerializer(Type)

取得快取的序列化程式,或建立並快取指定類型的序列化程式。

GetSerializableType(Type)

取得要序列化的型別。

GetSupportedContentTypes(String, Type)

取得 和 支援的內容類型 IOutputFormatterobjectTypecontentType 篩選清單。

(繼承來源 OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

Encoding根據提供的內容類型,決定讀取或寫入 HTTP 實體主體所支援編碼的最佳方式。

(繼承來源 TextOutputFormatter)
Serialize(XmlSerializer, XmlWriter, Object)

使用傳入 xmlSerializer 的 和 xmlWriter 序列化值。

WriteAsync(OutputFormatterWriteContext)

寫入 物件,此物件是由 的 Object 屬性工作表示 context

(繼承來源 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext)

寫入回應本文。

(繼承來源 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext, Encoding)

寫入回應本文。

WriteResponseHeaders(OutputFormatterWriteContext)

設定 物件上的 HttpResponse 標頭。

(繼承來源 OutputFormatter)

適用於