Sdílet prostřednictvím


JsonMetadataServices.CreateICollectionInfo<TCollection,TElement> Metoda

Definice

Vytvoří metadata pro typy přiřaditelné k 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)

Parametry typu

TCollection

Obecná definice typu.

TElement

Obecná definice typu elementu.

Parametry

options
JsonSerializerOptions

Slouží JsonSerializerOptions k serializaci a deserializaci.

collectionInfo
JsonCollectionInfoValues<TCollection>

Poskytuje serializace metadata o typu kolekce.

Návraty

JsonTypeInfo<TCollection>

Serializace metadat pro daný typ.

Poznámky

Toto rozhraní API je určené pro použití výstupem zdrojového generátoru System.Text.Json a nemělo by se volat přímo.

Platí pro