Table of Contents

Interface IReaderRow

Namespace
CsvHelper
Assembly
CsvHelper.dll

Defines methods used to read parsed data from a CSV file row.

public interface IReaderRow

Properties

ColumnCount

Gets the column count of the current row. This should match Count.

int ColumnCount { get; }

Property Value

int

Configuration

Gets or sets the configuration.

IReaderConfiguration Configuration { get; }

Property Value

IReaderConfiguration

Context

Gets the reading context.

CsvContext Context { get; }

Property Value

CsvContext

CurrentIndex

Gets the field index the reader is currently on.

int CurrentIndex { get; }

Property Value

int

HeaderRecord

Gets the header record.

string[]? HeaderRecord { get; }

Property Value

string[]

this[int]

Gets the raw field at position (column) index.

string? this[int index] { get; }

Parameters

index int

The zero based index of the field.

Property Value

string

The raw field.

this[string]

Gets the raw field at position (column) name.

string? this[string name] { get; }

Parameters

name string

The named index of the field.

Property Value

string

The raw field.

this[string, int]

Gets the raw field at position (column) name.

string? this[string name, int index] { get; }

Parameters

name string

The named index of the field.

index int

The zero based index of the field.

Property Value

string

The raw field.

Parser

Gets the parser.

IParser Parser { get; }

Property Value

IParser

Methods

GetField(int)

Gets the raw field at position (column) index.

string? GetField(int index)

Parameters

index int

The zero based index of the field.

Returns

string

The raw field.

GetField(string)

Gets the raw field at position (column) name.

string? GetField(string name)

Parameters

name string

The named index of the field.

Returns

string

The raw field.

GetField(string, int)

Gets the raw field at position (column) name and the index instance of that field. The index is used when there are multiple columns with the same header name.

string? GetField(string name, int index)

Parameters

name string

The named index of the field.

index int

The zero based index of the instance of the field.

Returns

string

The raw field.

GetField(Type, int)

Gets the field converted to object using the specified ITypeConverter.

object? GetField(Type type, int index)

Parameters

type Type

The type of the field.

index int

The index of the field.

Returns

object

The field converted to object.

GetField(Type, int, ITypeConverter)

Gets the field converted to object using the specified ITypeConverter.

object? GetField(Type type, int index, ITypeConverter converter)

Parameters

type Type

The type of the field.

index int

The index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to object.

Returns

object

The field converted to object.

GetField(Type, string)

Gets the field converted to object using the specified ITypeConverter.

object? GetField(Type type, string name)

Parameters

type Type

The type of the field.

name string

The named index of the field.

Returns

object

The field converted to object.

GetField(Type, string, ITypeConverter)

Gets the field converted to object using the specified ITypeConverter.

object? GetField(Type type, string name, ITypeConverter converter)

Parameters

type Type

The type of the field.

name string

The named index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to object.

Returns

object

The field converted to object.

GetField(Type, string, int)

Gets the field converted to object using the specified ITypeConverter.

object? GetField(Type type, string name, int index)

Parameters

type Type

The type of the field.

name string

The named index of the field.

index int

The zero based index of the instance of the field.

Returns

object

The field converted to object.

GetField(Type, string, int, ITypeConverter)

Gets the field converted to object using the specified ITypeConverter.

object? GetField(Type type, string name, int index, ITypeConverter converter)

Parameters

type Type

The type of the field.

name string

The named index of the field.

index int

The zero based index of the instance of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to object.

Returns

object

The field converted to object.

GetField<T>(int)

Gets the field converted to Type T at position (column) index.

T? GetField<T>(int index)

Parameters

index int

The zero based index of the field.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

GetField<T>(int, ITypeConverter)

Gets the field converted to Type T at position (column) index using the given ITypeConverter.

T? GetField<T>(int index, ITypeConverter converter)

Parameters

index int

The zero based index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

GetField<T>(string)

Gets the field converted to Type T at position (column) name.

T? GetField<T>(string name)

Parameters

name string

The named index of the field.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

GetField<T>(string, ITypeConverter)

Gets the field converted to Type T at position (column) name using the given ITypeConverter.

T? GetField<T>(string name, ITypeConverter converter)

Parameters

name string

The named index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

GetField<T>(string, int)

Gets the field converted to Type T at position (column) name and the index instance of that field. The index is used when there are multiple columns with the same header name.

T? GetField<T>(string name, int index)

Parameters

name string

The named index of the field.

index int

The zero based index of the instance of the field.

Returns

T

Type Parameters

T

GetField<T>(string, int, ITypeConverter)

Gets the field converted to Type T at position (column) name and the index instance of that field. The index is used when there are multiple columns with the same header name.

T? GetField<T>(string name, int index, ITypeConverter converter)

Parameters

name string

The named index of the field.

index int

The zero based index of the instance of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

GetField<T, TConverter>(int)

Gets the field converted to Type T at position (column) index using the given ITypeConverter.

T? GetField<T, TConverter>(int index) where TConverter : ITypeConverter

Parameters

index int

The zero based index of the field.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

TConverter

The ITypeConverter used to convert the field to Type T.

GetField<T, TConverter>(string)

Gets the field converted to Type T at position (column) name using the given ITypeConverter.

T? GetField<T, TConverter>(string name) where TConverter : ITypeConverter

Parameters

name string

The named index of the field.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

TConverter

The ITypeConverter used to convert the field to Type T.

GetField<T, TConverter>(string, int)

Gets the field converted to Type T at position (column) name and the index instance of that field. The index is used when there are multiple columns with the same header name.

T? GetField<T, TConverter>(string name, int index) where TConverter : ITypeConverter

Parameters

name string

The named index of the field.

index int

The zero based index of the instance of the field.

Returns

T

The field converted to Type T.

Type Parameters

T

The Type of the field.

TConverter

The ITypeConverter used to convert the field to Type T.

GetRecord(Type)

Gets the record.

object GetRecord(Type type)

Parameters

type Type

The Type of the record.

Returns

object

The record.

GetRecord<T>()

Gets the record converted into Type T.

T GetRecord<T>()

Returns

T

The record converted to Type T.

Type Parameters

T

The Type of the record.

GetRecord<T>(T)

Get the record converted into Type T.

T GetRecord<T>(T anonymousTypeDefinition)

Parameters

anonymousTypeDefinition T

The anonymous type definition to use for the record.

Returns

T

The record converted to Type T.

Type Parameters

T

The Type of the record.

TryGetField(Type, int, ITypeConverter, out object?)

Gets the field converted to Type T at position (column) index using the specified ITypeConverter.

bool TryGetField(Type type, int index, ITypeConverter converter, out object? field)

Parameters

type Type

The Type of the field.

index int

The zero based index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

field object

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

TryGetField(Type, int, out object?)

Gets the field converted to Type T at position (column) index.

bool TryGetField(Type type, int index, out object? field)

Parameters

type Type

The Type of the field.

index int

The zero based index of the field.

field object

The field converted to type T.

Returns

bool

A value indicating if the get was successful.

TryGetField(Type, string, ITypeConverter, out object?)

Gets the field converted to Type T at position (column) name using the specified ITypeConverter.

bool TryGetField(Type type, string name, ITypeConverter converter, out object? field)

Parameters

type Type

The Type of the field.

name string

The named index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

field object

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

TryGetField(Type, string, int, ITypeConverter, out object?)

Gets the field converted to Type T at position (column) name using the specified ITypeConverter.

bool TryGetField(Type type, string name, int index, ITypeConverter converter, out object? field)

Parameters

type Type

The Type of the field.

name string

The named index of the field.

index int

The zero based index of the instance of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

field object

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

TryGetField(Type, string, int, out object?)

Gets the field converted to Type T at position (column) name and the index instance of that field. The index is used when there are multiple columns with the same header name.

bool TryGetField(Type type, string name, int index, out object? field)

Parameters

type Type

The Type of the field.

name string

The named index of the field.

index int

The zero based index of the instance of the field.

field object

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

TryGetField(Type, string, out object?)

Gets the field converted to Type T at position (column) name.

bool TryGetField(Type type, string name, out object? field)

Parameters

type Type

The Type of the field.

name string

The named index of the field.

field object

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

TryGetField<T>(int, ITypeConverter, out T?)

Gets the field converted to Type T at position (column) index using the specified ITypeConverter.

bool TryGetField<T>(int index, ITypeConverter converter, out T? field)

Parameters

index int

The zero based index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TryGetField<T>(int, out T?)

Gets the field converted to Type T at position (column) index.

bool TryGetField<T>(int index, out T? field)

Parameters

index int

The zero based index of the field.

field T

The field converted to type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TryGetField<T>(string, ITypeConverter, out T?)

Gets the field converted to Type T at position (column) name using the specified ITypeConverter.

bool TryGetField<T>(string name, ITypeConverter converter, out T? field)

Parameters

name string

The named index of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TryGetField<T>(string, int, ITypeConverter, out T?)

Gets the field converted to Type T at position (column) name using the specified ITypeConverter.

bool TryGetField<T>(string name, int index, ITypeConverter converter, out T? field)

Parameters

name string

The named index of the field.

index int

The zero based index of the instance of the field.

converter ITypeConverter

The ITypeConverter used to convert the field to Type T.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TryGetField<T>(string, int, out T?)

Gets the field converted to Type T at position (column) name and the index instance of that field. The index is used when there are multiple columns with the same header name.

bool TryGetField<T>(string name, int index, out T? field)

Parameters

name string

The named index of the field.

index int

The zero based index of the instance of the field.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

TryGetField<T>(string, out T?)

Gets the field converted to Type T at position (column) name.

bool TryGetField<T>(string name, out T? field)

Parameters

name string

The named index of the field.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TryGetField<T, TConverter>(int, out T?)

Gets the field converted to Type T at position (column) index using the specified ITypeConverter.

bool TryGetField<T, TConverter>(int index, out T? field) where TConverter : ITypeConverter

Parameters

index int

The zero based index of the field.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TConverter

The ITypeConverter used to convert the field to Type T.

TryGetField<T, TConverter>(string, int, out T?)

Gets the field converted to Type T at position (column) name using the specified ITypeConverter.

bool TryGetField<T, TConverter>(string name, int index, out T? field) where TConverter : ITypeConverter

Parameters

name string

The named index of the field.

index int

The zero based index of the instance of the field.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TConverter

The ITypeConverter used to convert the field to Type T.

TryGetField<T, TConverter>(string, out T?)

Gets the field converted to Type T at position (column) name using the specified ITypeConverter.

bool TryGetField<T, TConverter>(string name, out T? field) where TConverter : ITypeConverter

Parameters

name string

The named index of the field.

field T

The field converted to Type T.

Returns

bool

A value indicating if the get was successful.

Type Parameters

T

The Type of the field.

TConverter

The ITypeConverter used to convert the field to Type T.