Interface IWriter
- Namespace
- CsvHelper
- Assembly
- CsvHelper.dll
Defines methods used to write to a CSV file.
public interface IWriter : IWriterRow, IDisposable, IAsyncDisposable
- Inherited Members
Methods
Flush()
Flushes the internal buffer to the TextWriter then flushes the TextWriter.
void Flush()
FlushAsync()
Flushes the internal buffer to the TextWriter then flushes the TextWriter.
Task FlushAsync()
Returns
NextRecord()
Ends writing of the current record and starts a new record. This flushes the buffer to the TextWriter but does not flush the TextWriter.
void NextRecord()
NextRecordAsync()
Ends writing of the current record and starts a new record. This flushes the buffer to the TextWriter but does not flush the TextWriter.
Task NextRecordAsync()
Returns
WriteRecords(IEnumerable)
Writes the list of records to the CSV file.
void WriteRecords(IEnumerable records)
Parameters
records
IEnumerableThe records to write.
WriteRecordsAsync(IEnumerable, CancellationToken)
Writes the list of records to the CSV file.
Task WriteRecordsAsync(IEnumerable records, CancellationToken cancellationToken = default)
Parameters
records
IEnumerableThe records to write.
cancellationToken
CancellationTokenThe cancellation token to stop the writing.
Returns
WriteRecordsAsync<T>(IAsyncEnumerable<T>, CancellationToken)
Writes the list of records to the CSV file.
Task WriteRecordsAsync<T>(IAsyncEnumerable<T> records, CancellationToken cancellationToken = default)
Parameters
records
IAsyncEnumerable<T>The records to write.
cancellationToken
CancellationTokenThe cancellation token to stop the writing.
Returns
Type Parameters
T
Record type.
WriteRecordsAsync<T>(IEnumerable<T>, CancellationToken)
Writes the list of records to the CSV file.
Task WriteRecordsAsync<T>(IEnumerable<T> records, CancellationToken cancellationToken = default)
Parameters
records
IEnumerable<T>The records to write.
cancellationToken
CancellationTokenThe cancellation token to stop the writing.
Returns
Type Parameters
T
Record type.
WriteRecords<T>(IEnumerable<T>)
Writes the list of records to the CSV file.
void WriteRecords<T>(IEnumerable<T> records)
Parameters
records
IEnumerable<T>The records to write.
Type Parameters
T
Record type.