JsonTypeInfo.ElementType Property

Definition

Gets the element type corresponding to an enumerable, dictionary or optional type.

C#
public Type? ElementType { get; }

Property Value

Remarks

Returns the element type for enumerable types, the value type for dictionary types,

and the underlying type for Nullable<T> or F# optional types.

Returns null for all other types or types using custom converters.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)