IReader Interface
Defines methods used to read parsed data from a CSV file.
Namespace
CsvHelper
Interfaces
Implementing Types
graph BT Type-.->Interface0["IReaderRow"] click Interface0 "/CsvHelper/api/CsvHelper/IReaderRow" Type-.->Interface1["IDisposable"] Type["IReader"] class Type type-node Implementing0["CsvReader"]-.->Type click Implementing0 "/CsvHelper/api/CsvHelper/CsvReader"

Syntax

public interface IReader : IReaderRow, IDisposable

Methods

Name Return Value Summary
EnumerateRecords<T>(T) IEnumerable<T>
Enumerates the records hydrating the given record instance with row data. The record instance is re-used and not cleared on each enumeration. This only works for streaming rows. If any methods are called on the projection that force the evaluation of the IEnumerable, such as ToList(), the entire list will contain the same instance of the record, which is the last row.
EnumerateRecordsAsync<T>(T, CancellationToken) IAsyncEnumerable<T>
Enumerates the records hydrating the given record instance with row data. The record instance is re-used and not cleared on each enumeration. This only works for streaming rows. If any methods are called on the projection that force the evaluation of the IEnumerable, such as ToList(), the entire list will contain the same instance of the record, which is the last row.
GetRecords(Type) IEnumerable<object>
Gets all the records in the CSV file and converts each to the specified Type. The Read method should not be used when using this.
GetRecords<T>() IEnumerable<T>
Gets all the records in the CSV file and converts each to T. The Read method should not be used when using this.
GetRecords<T>(T) IEnumerable<T>
Gets all the records in the CSV file and converts each to T. The Read method should not be used when using this.
GetRecordsAsync(Type, CancellationToken) IAsyncEnumerable<object>
Gets all the records in the CSV file and converts each to the specified Type. The Read method should not be used when using this.
GetRecordsAsync<T>(CancellationToken) IAsyncEnumerable<T>
Gets all the records in the CSV file and converts each to T. The Read method should not be used when using this.
GetRecordsAsync<T>(T, CancellationToken) IAsyncEnumerable<T>
Gets all the records in the CSV file and converts each to T. The Read method should not be used when using this.
Read() bool
Advances the reader to the next record. This will not read headers. You need to call Read() then ReadHeader() for the headers to be read.
ReadAsync() Task<bool>
Advances the reader to the next record. This will not read headers. You need to call ReadAsync() then ReadHeader() for the headers to be read.
ReadHeader() bool
Reads the header record without reading the first row.