Table of Contents

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

Task

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

Task

WriteRecords(IEnumerable)

Writes the list of records to the CSV file.

void WriteRecords(IEnumerable records)

Parameters

records IEnumerable

The records to write.

WriteRecordsAsync(IEnumerable, CancellationToken)

Writes the list of records to the CSV file.

Task WriteRecordsAsync(IEnumerable records, CancellationToken cancellationToken = default)

Parameters

records IEnumerable

The records to write.

cancellationToken CancellationToken

The cancellation token to stop the writing.

Returns

Task

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 CancellationToken

The cancellation token to stop the writing.

Returns

Task

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 CancellationToken

The cancellation token to stop the writing.

Returns

Task

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.