JsonSerializerContext 類別

定義

提供一組與 JSON 序列化相關的型別相關中繼資料。

public ref class JsonSerializerContext abstract
public ref class JsonSerializerContext abstract : System::Text::Json::Serialization::Metadata::IJsonTypeInfoResolver
public abstract class JsonSerializerContext
public abstract class JsonSerializerContext : System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver
type JsonSerializerContext = class
type JsonSerializerContext = class
    interface IJsonTypeInfoResolver
Public MustInherit Class JsonSerializerContext
Public MustInherit Class JsonSerializerContext
Implements IJsonTypeInfoResolver
繼承
JsonSerializerContext
實作

建構函式

JsonSerializerContext(JsonSerializerOptions)

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

屬性

GeneratedSerializerOptions

取得內容的預設執行時間選項。

Options

取得內容的執行時間指定選項。 如果具現化內容時未傳遞任何選項,則會系結並傳回新的實例。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
GetTypeInfo(Type)

取得指定型別的中繼資料。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

IJsonTypeInfoResolver.GetTypeInfo(Type, JsonSerializerOptions)

JsonTypeInfo解析所要求類型和選項的合約。

擴充方法

WithAddedModifier(IJsonTypeInfoResolver, Action<JsonTypeInfo>)

建立解析程式,並將修改套用至來源 resolver 所產生的中繼資料。

適用於