JsonSerializerContext(JsonSerializerOptions) 建構函式

定義

建立 的 JsonSerializerContext 實例,並將它系結至指定的 JsonSerializerOptions

protected:
 JsonSerializerContext(System::Text::Json::JsonSerializerOptions ^ options);
protected JsonSerializerContext (System.Text.Json.JsonSerializerOptions? options);
new System.Text.Json.Serialization.JsonSerializerContext : System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.JsonSerializerContext
Protected Sub New (options As JsonSerializerOptions)

參數

options
JsonSerializerOptions

內容實例的執行時間提供選項。

備註

如果未傳遞任何實例選項,則在內容系結使用 AddContext<TContext>() 或 呼叫之前 Options ,不會設定任何選項,其中會建立並系結新的選項實例。

適用於