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
recordsIEnumerableThe records to write.
WriteRecordsAsync(IEnumerable, CancellationToken)
Writes the list of records to the CSV file.
Task WriteRecordsAsync(IEnumerable records, CancellationToken cancellationToken = default)
Parameters
recordsIEnumerableThe records to write.
cancellationTokenCancellationTokenThe 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
recordsIAsyncEnumerable<T>The records to write.
cancellationTokenCancellationTokenThe cancellation token to stop the writing.
Returns
Type Parameters
TRecord 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
recordsIEnumerable<T>The records to write.
cancellationTokenCancellationTokenThe cancellation token to stop the writing.
Returns
Type Parameters
TRecord type.
WriteRecords<T>(IEnumerable<T>)
Writes the list of records to the CSV file.
void WriteRecords<T>(IEnumerable<T> records)
Parameters
recordsIEnumerable<T>The records to write.
Type Parameters
TRecord type.