Table of Contents

Class IndexAttribute

Namespace
CsvHelper.Configuration.Attributes
Assembly
CsvHelper.dll

When reading, is used to get the field at the given index. When writing, the fields will be written in the order of the field indexes.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class IndexAttribute : Attribute, IMemberMapper, IParameterMapper
Inheritance
IndexAttribute
Implements
Inherited Members

Constructors

IndexAttribute(int, int)

When reading, is used to get the field at the given index. When writing, the fields will be written in the order of the field indexes.

public IndexAttribute(int index, int indexEnd = -1)

Parameters

index int

The index.

indexEnd int

The index end.

Properties

Index

Gets the index.

public int Index { get; }

Property Value

int

IndexEnd

Gets the index end.

public int IndexEnd { get; }

Property Value

int

Methods

ApplyTo(MemberMap)

public void ApplyTo(MemberMap memberMap)

Parameters

memberMap MemberMap

ApplyTo(ParameterMap)

public void ApplyTo(ParameterMap parameterMap)

Parameters

parameterMap ParameterMap