共用方式為


JsonMetadataServices.CreateICollectionInfo<TCollection,TElement> 方法

定義

為可指派給 ICollection<T> 的類型建立中繼資料。

public:
generic <typename TCollection, typename TElement>
 where TCollection : System::Collections::Generic::ICollection<TElement> static System::Text::Json::Serialization::Metadata::JsonTypeInfo<TCollection> ^ CreateICollectionInfo(System::Text::Json::JsonSerializerOptions ^ options, System::Text::Json::Serialization::Metadata::JsonCollectionInfoValues<TCollection> ^ collectionInfo);
public static System.Text.Json.Serialization.Metadata.JsonTypeInfo<TCollection> CreateICollectionInfo<TCollection,TElement> (System.Text.Json.JsonSerializerOptions options, System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues<TCollection> collectionInfo) where TCollection : System.Collections.Generic.ICollection<TElement>;
static member CreateICollectionInfo : System.Text.Json.JsonSerializerOptions * System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues<'Collection (requires 'Collection :> System.Collections.Generic.ICollection<'Element>)> -> System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Collection (requires 'Collection :> System.Collections.Generic.ICollection<'Element>)> (requires 'Collection :> System.Collections.Generic.ICollection<'Element>)
Public Shared Function CreateICollectionInfo(Of TCollection As ICollection(Of TElement), TElement As ICollection(Of TElement)) (options As JsonSerializerOptions, collectionInfo As JsonCollectionInfoValues(Of TCollection)) As JsonTypeInfo(Of TCollection)

類型參數

TCollection

型別的泛型定義。

TElement

專案類型的泛型定義。

參數

options
JsonSerializerOptions

JsonSerializerOptions 用於序列化和還原序列化的 。

collectionInfo
JsonCollectionInfoValues<TCollection>

提供有關集合類型的序列化中繼資料。

傳回

JsonTypeInfo<TCollection>

指定型別的序列化中繼資料。

備註

此 API 可供 System.Text.Json 來源產生器的輸出使用,不應直接呼叫。

適用於