Язык

JsonMetadataServices.CreateImmutableEnumerableInfo<TCollection,TElement> Метод

Определение

Создает метаданные для неизменяемых типов коллекций без словаря.

public:
generic <typename TCollection, typename TElement>
 where TCollection : System::Collections::Generic::IEnumerable<TElement> static System::Text::Json::Serialization::Metadata::JsonTypeInfo<TCollection> ^ CreateImmutableEnumerableInfo(System::Text::Json::JsonSerializerOptions ^ options, System::Text::Json::Serialization::Metadata::JsonCollectionInfoValues<TCollection> ^ collectionInfo, Func<System::Collections::Generic::IEnumerable<TElement> ^, TCollection> ^ createRangeFunc);
public static System.Text.Json.Serialization.Metadata.JsonTypeInfo<TCollection> CreateImmutableEnumerableInfo<TCollection,TElement>(System.Text.Json.JsonSerializerOptions options, System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues<TCollection> collectionInfo, Func<System.Collections.Generic.IEnumerable<TElement>,TCollection> createRangeFunc) where TCollection : System.Collections.Generic.IEnumerable<TElement>;
static member CreateImmutableEnumerableInfo : System.Text.Json.JsonSerializerOptions * System.Text.Json.Serialization.Metadata.JsonCollectionInfoValues<#seq<'Element>> * Func<seq<'Element>, #seq<'Element>> -> System.Text.Json.Serialization.Metadata.JsonTypeInfo<#seq<'Element>>
Public Shared Function CreateImmutableEnumerableInfo(Of TCollection As IEnumerable(Of TElement), TElement As IEnumerable(Of TElement)) (options As JsonSerializerOptions, collectionInfo As JsonCollectionInfoValues(Of TCollection), createRangeFunc As Func(Of IEnumerable(Of TElement), TCollection)) As JsonTypeInfo(Of TCollection)

Параметры типа

TCollection

Универсальное определение типа.

TElement

Универсальное определение типа элемента.

Параметры

options
JsonSerializerOptions

Используется JsonSerializerOptions для сериализации и десериализации.

collectionInfo
JsonCollectionInfoValues<TCollection>

Предоставляет метаданные сериализации о типе коллекции.

createRangeFunc
Func<IEnumerable<TElement>,TCollection>

Метод создания неизменяемого экземпляра словаря.

Возвращаемое значение

JsonTypeInfo<TCollection>

Метаданные сериализации для заданного типа.

Комментарии

Этот API предназначен для использования выходными данными генератора источника System.Text.Json и не должен вызываться напрямую.

Применяется к