CsvSerializableAttribute Class

Declares a type for which a CsvSerializerContext generates the serialization metadata.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class CsvSerializableAttribute : CsvAttribute
Inheritance
CsvAttribute CsvSerializableAttribute

Constructors

NameDescription
CsvSerializableAttribute(Type)Declares a type for which a CsvSerializerContext generates the serialization metadata.

CsvSerializableAttribute(Type)

CsvSerializableAttribute.cs

Declares a type for which a CsvSerializerContext generates the serialization metadata.

public CsvSerializableAttribute(Type type)

Parameters

type Type
The type of the records to serialize.

Properties

NameDescription
TypeGets the type of the records to serialize.
TypeInfoPropertyNameGets or sets the name of the generated property that returns the metadata of the type. Default is the name of the type.

Gets the type of the records to serialize.

public Type Type { get; }

Property value

Type

TypeInfoPropertyName

CsvSerializableAttribute.cs

Gets or sets the name of the generated property that returns the metadata of the type. Default is the name of the type.

public string? TypeInfoPropertyName { get; set; }

Property value

string?