語言

JsonSerializerOptions.Web 屬性

定義

會取得一個唯讀、單例的實例 JsonSerializerOptions ,使用網頁設定。

public:
 static property System::Text::Json::JsonSerializerOptions ^ Web { System::Text::Json::JsonSerializerOptions ^ get(); };
public static System.Text.Json.JsonSerializerOptions Web { [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] get; }
public static System.Text.Json.JsonSerializerOptions Web { get; }
[<get: System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<get: System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member Web : System.Text.Json.JsonSerializerOptions
static member Web : System.Text.Json.JsonSerializerOptions
Public Shared ReadOnly Property Web As JsonSerializerOptions

屬性值

屬性

備註

每個 JsonSerializerOptions 實例都封裝其自己的序列化中繼資料快取,

因此每次需要時都使用新的預設實例,可能會導致轉換器重複計算。

此特性提供一個共享實例,可被任意數量的元件消耗,且無需重新計算轉換器。

適用於