ReflectionCsvTypeInfoResolver Class

Creates the metadata of types with reflection.

public sealed class ReflectionCsvTypeInfoResolver : ICsvTypeInfoResolver

Remarks

This resolver is not compatible with trimming and Native AOT: use a generated CsvSerializerContext instead.

Implements

Constructors

NameDescription
ReflectionCsvTypeInfoResolver()Initializes a new instance of the ReflectionCsvTypeInfoResolver class.

ReflectionCsvTypeInfoResolver()

ReflectionCsvTypeInfoResolver.cs

Initializes a new instance of the ReflectionCsvTypeInfoResolver class.

[RequiresDynamicCode("Reflection-based CSV serialization is not compatible with trimming and Native AOT. Use a generated CsvSerializerContext and the overloads that take a CsvTypeInfo.")]
[RequiresUnreferencedCode("Reflection-based CSV serialization is not compatible with trimming and Native AOT. Use a generated CsvSerializerContext and the overloads that take a CsvTypeInfo.")]
public ReflectionCsvTypeInfoResolver()

Properties

NameDescription
DefaultGets the default instance.

Gets the default instance.

public static ReflectionCsvTypeInfoResolver Default { get; }

Methods

NameDescription
GetTypeInfo(Type, CsvSerializerOptions)Gets the serialization metadata of a type.

GetTypeInfo(Type, CsvSerializerOptions)

ReflectionCsvTypeInfoResolver.cs

Gets the serialization metadata of a type.

public CsvTypeInfo? GetTypeInfo(Type type, CsvSerializerOptions options)

Parameters

type Type
The type.
options CsvSerializerOptions
The options the metadata is created for.

Returns

CsvTypeInfo? The metadata, or null when the resolver does not support type.