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
Configuration
Gets or sets the configuration.
IReaderConfiguration Configuration { get; }
Property Value
Context
Gets the reading context.
CsvContext Context { get; }
Property Value
CurrentIndex
Gets the field index the reader is currently on.
int CurrentIndex { get; }
Property Value
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
indexintThe 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
namestringThe 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
Property Value
- string
The raw field.
Parser
Gets the parser.
IParser Parser { get; }
Property Value
Methods
GetField(int)
Gets the raw field at position (column) index.
string? GetField(int index)
Parameters
indexintThe 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
namestringThe 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
namestringThe named index of the field.
indexintThe 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
Returns
GetField(Type, int, ITypeConverter)
Gets the field converted to object using the specified ITypeConverter.
object? GetField(Type type, int index, ITypeConverter converter)
Parameters
typeTypeThe type of the field.
indexintThe index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to object.
Returns
GetField(Type, string)
Gets the field converted to object using the specified ITypeConverter.
object? GetField(Type type, string name)
Parameters
Returns
GetField(Type, string, ITypeConverter)
Gets the field converted to object using the specified ITypeConverter.
object? GetField(Type type, string name, ITypeConverter converter)
Parameters
typeTypeThe type of the field.
namestringThe named index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to object.
Returns
GetField(Type, string, int)
Gets the field converted to object using the specified ITypeConverter.
object? GetField(Type type, string name, int index)
Parameters
typeTypeThe type of the field.
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
Returns
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
typeTypeThe type of the field.
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
converterITypeConverterThe ITypeConverter used to convert the field to object.
Returns
GetField<T>(int)
Gets the field converted to Type T at position (column) index.
T? GetField<T>(int index)
Parameters
indexintThe zero based index of the field.
Returns
- T
The field converted to Type T.
Type Parameters
TThe 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
indexintThe zero based index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
Returns
- T
The field converted to Type T.
Type Parameters
TThe Type of the field.
GetField<T>(string)
Gets the field converted to Type T at position (column) name.
T? GetField<T>(string name)
Parameters
namestringThe named index of the field.
Returns
- T
The field converted to Type T.
Type Parameters
TThe 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
namestringThe named index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
Returns
- T
The field converted to Type T.
Type Parameters
TThe 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
namestringThe named index of the field.
indexintThe 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
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
Returns
- T
The field converted to Type T.
Type Parameters
TThe 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
indexintThe zero based index of the field.
Returns
- T
The field converted to Type T.
Type Parameters
TThe Type of the field.
TConverterThe 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
namestringThe named index of the field.
Returns
- T
The field converted to Type T.
Type Parameters
TThe Type of the field.
TConverterThe 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
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
Returns
- T
The field converted to Type T.
Type Parameters
TThe Type of the field.
TConverterThe ITypeConverter used to convert the field to Type T.
GetRecord(Type)
Gets the record.
object GetRecord(Type type)
Parameters
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
TThe Type of the record.
GetRecord<T>(T)
Get the record converted into Type T.
T GetRecord<T>(T anonymousTypeDefinition)
Parameters
anonymousTypeDefinitionTThe anonymous type definition to use for the record.
Returns
- T
The record converted to Type T.
Type Parameters
TThe 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
typeTypeThe Type of the field.
indexintThe zero based index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
fieldobjectThe 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
typeTypeThe Type of the field.
indexintThe zero based index of the field.
fieldobjectThe 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
typeTypeThe Type of the field.
namestringThe named index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
fieldobjectThe 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
typeTypeThe Type of the field.
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
fieldobjectThe 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
typeTypeThe Type of the field.
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
fieldobjectThe 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
typeTypeThe Type of the field.
namestringThe named index of the field.
fieldobjectThe 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
indexintThe zero based index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
fieldTThe field converted to Type T.
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe 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
indexintThe zero based index of the field.
fieldTThe field converted to type T.
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe 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
namestringThe named index of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
fieldTThe field converted to Type T.
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe 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
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
converterITypeConverterThe ITypeConverter used to convert the field to Type T.
fieldTThe field converted to Type T.
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe 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
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
fieldTThe 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
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe 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
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe Type of the field.
TConverterThe 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
namestringThe named index of the field.
indexintThe zero based index of the instance of the field.
fieldTThe field converted to Type T.
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe Type of the field.
TConverterThe 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
Returns
- bool
A value indicating if the get was successful.
Type Parameters
TThe Type of the field.
TConverterThe ITypeConverter used to convert the field to Type T.