Table of Contents

Class CsvFieldAttribute

Namespace
NuvTools.Report.Sheet.Csv.Attributes
Assembly
NuvTools.Report.dll

Maps a property to a CSV field by position and provides optional conversion settings.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class CsvFieldAttribute : Attribute
Inheritance
CsvFieldAttribute
Inherited Members

Constructors

CsvFieldAttribute(int)

Initializes a new instance of CsvFieldAttribute with the specified zero-based field position.

public CsvFieldAttribute(int order)

Parameters

order int

The zero-based position of the field in the CSV record.

Properties

Caption

Gets or sets a display name for the field.

public string? Caption { get; set; }

Property Value

string

Converter

Gets or sets the type of an IFieldConverter implementation used to convert the raw string value.

public Type? Converter { get; set; }

Property Value

Type

Format

Gets or sets a format string passed to the converter (e.g. "yyyyMMdd" for dates).

public string? Format { get; set; }

Property Value

string

Order

Gets the zero-based position of the field in the CSV record.

public int Order { get; }

Property Value

int

Trim

Gets or sets the trim mode applied to the raw field value before conversion. Defaults to None.

public TrimMode Trim { get; set; }

Property Value

TrimMode