MvcNewtonsoftJsonOptions 類別

定義

使用 Newtonsoft.JSON 為 JSON 格式器提供程式設計設定。

public ref class MvcNewtonsoftJsonOptions : System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Mvc::Infrastructure::ICompatibilitySwitch ^>
public class MvcNewtonsoftJsonOptions : System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.Infrastructure.ICompatibilitySwitch>
type MvcNewtonsoftJsonOptions = class
    interface seq<ICompatibilitySwitch>
    interface IEnumerable
Public Class MvcNewtonsoftJsonOptions
Implements IEnumerable(Of ICompatibilitySwitch)
繼承
MvcNewtonsoftJsonOptions
實作

建構函式

MvcNewtonsoftJsonOptions()

使用 Newtonsoft.JSON 為 JSON 格式器提供程式設計設定。

屬性

AllowInputFormatterExceptionMessages

取得或設定旗標,以判斷 是否將 來自 NewtonsoftJsonInputFormatter JSON 還原序列化的錯誤訊息新增至 ModelStateDictionary 。 如果 false 為 ,則會改用泛型錯誤訊息。

InputFormatterMemoryBufferThreshold

取得未設定 時 SuppressInputFormatterBuffering ,要緩衝在記憶體中的大小上限。

NewtonsoftJsonInputFormatter 預設會緩衝輸入資料流程,在緩衝處理至磁片之前,在記憶體中緩衝到特定數量。 此選項會設定 MVC 在記憶體中緩衝的位元組大小,再切換至磁片。

OutputFormatterMemoryBufferThreshold

取得未設定 時 SuppressOutputFormatterBuffering ,要緩衝在記憶體中的大小上限。

NewtonsoftJsonOutputFormatter 預設會緩衝輸出資料流程,在緩衝處理至磁片之前,在記憶體中緩衝到特定數量。 此選項會設定 MVC 在記憶體中緩衝的位元組大小,再切換至磁片。

ReadJsonWithRequestCulture

取得或設定旗標,以判斷 目前 HTTP 要求的 值 CurrentCulture 是否用於 的 JSON 還原序列化。 NewtonsoftJsonInputFormatter

SerializerSettings

Newtonsoft.Json.JsonSerializerSettings取得這個應用程式所使用的 。

明確介面實作

IEnumerable.GetEnumerator()

使用 Newtonsoft.JSON 為 JSON 格式器提供程式設計設定。

IEnumerable<ICompatibilitySwitch>.GetEnumerator()

使用 Newtonsoft.JSON 為 JSON 格式器提供程式設計設定。

擴充方法

UseCamelCasing(MvcNewtonsoftJsonOptions, Boolean)

設定 JSON 序列化的大小寫行為,以針對屬性名稱使用 Camel 大小寫,並選擇性地用於動態類型和字典索引鍵。

UseMemberCasing(MvcNewtonsoftJsonOptions)

設定 JSON 序列化的大小寫行為,以針對屬性名稱、動態類型和字典索引鍵的屬性使用成員的大小寫。

適用於