CsvColumnIndexAttribute Class

Sets the 0-based index of the column of a property or a field.

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public sealed class CsvColumnIndexAttribute : CsvAttribute

Remarks

Without a header row, the serializer reads and writes the value of the member in this column. A member without this attribute uses the column at its position in the list of the members, and the columns that no member uses are written as empty values. With a header row, the columns are read by name.

Inheritance
CsvAttribute CsvColumnIndexAttribute

Constructors

NameDescription
CsvColumnIndexAttribute(int)Sets the 0-based index of the column of a property or a field.

CsvColumnIndexAttribute(int)

CsvColumnIndexAttribute.cs

Sets the 0-based index of the column of a property or a field.

public CsvColumnIndexAttribute(int index)

Parameters

index int
The 0-based index of the column.

Remarks

Without a header row, the serializer reads and writes the value of the member in this column. A member without this attribute uses the column at its position in the list of the members, and the columns that no member uses are written as empty values. With a header row, the columns are read by name.

Properties

NameDescription
IndexGets the 0-based index of the column.

Gets the 0-based index of the column.

public int Index { get; }

Property value

int