Table of Contents

Class NameAttribute

Namespace
CsvHelper.Configuration.Attributes
Assembly
CsvHelper.dll

When reading, is used to get the field at the index of the name if there was a header specified. It will look for the first name match in the order listed. When writing, sets the name of the field in the header record. The first name will be used.

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

Constructors

NameAttribute(string)

When reading, is used to get the field at the index of the name if there was a header specified. It will look for the first name match in the order listed. When writing, sets the name of the field in the header record. The first name will be used.

public NameAttribute(string name)

Parameters

name string

The name

NameAttribute(params string[])

When reading, is used to get the field at the index of the name if there was a header specified. It will look for the first name match in the order listed. When writing, sets the name of the field in the header record. The first name will be used.

public NameAttribute(params string[] names)

Parameters

names string[]

The names.

Properties

Names

Gets the names.

public string[] Names { get; }

Property Value

string[]

Methods

ApplyTo(MemberMap)

public void ApplyTo(MemberMap memberMap)

Parameters

memberMap MemberMap

ApplyTo(ParameterMap)

public void ApplyTo(ParameterMap parameterMap)

Parameters

parameterMap ParameterMap