NewtonsoftJsonOutputFormatter 類別

定義

TextOutputFormatterJSON 內容的 。

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

建構函式

NewtonsoftJsonOutputFormatter(JsonSerializerSettings, ArrayPool<Char>, MvcOptions)
已淘汰.

初始化新的 NewtonsoftJsonOutputFormatter 執行個體。

NewtonsoftJsonOutputFormatter(JsonSerializerSettings, ArrayPool<Char>, MvcOptions, MvcNewtonsoftJsonOptions)

初始化新的 NewtonsoftJsonOutputFormatter 執行個體。

屬性

SerializerSettings

Newtonsoft.Json.JsonSerializerSettings取得用來設定 的 Newtonsoft.Json.JsonSerializer

SupportedEncodings

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

(繼承來源 TextOutputFormatter)
SupportedMediaTypes

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

(繼承來源 OutputFormatter)

方法

CanWriteResult(OutputFormatterCanWriteContext)

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

(繼承來源 OutputFormatter)
CanWriteType(Type)

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

(繼承來源 OutputFormatter)
CreateJsonSerializer()

在序列化期間呼叫 以建立 Newtonsoft.Json.JsonSerializer 。傳遞的格式器內容可讓您建立內容特定的序列化程式。

CreateJsonSerializer(OutputFormatterWriteContext)

在序列化期間呼叫 以建立 Newtonsoft.Json.JsonSerializer 。傳遞的格式器內容可讓您建立內容特定的序列化程式。

CreateJsonWriter(TextWriter)

在序列化期間呼叫 以建立 Newtonsoft.Json.JsonWriter

GetSupportedContentTypes(String, Type)

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

(繼承來源 OutputFormatter)
SelectCharacterEncoding(OutputFormatterWriteContext)

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

(繼承來源 TextOutputFormatter)
WriteAsync(OutputFormatterWriteContext)

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

(繼承來源 TextOutputFormatter)
WriteResponseBodyAsync(OutputFormatterWriteContext)

寫入回應本文。

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

寫入回應本文。

WriteResponseHeaders(OutputFormatterWriteContext)

設定 物件上的 HttpResponse 標頭。

(繼承來源 OutputFormatter)

適用於