CsvConverterWriteTSource(IEnumerableTSource, CsvWriter, CsvFromTSource) Method

Writes the content of a collection of TSource instances as CSV.

Definition

Namespace: FolkerKinzel.CsvTools.Mappings
Assembly: FolkerKinzel.CsvTools.Mappings (in FolkerKinzel.CsvTools.Mappings.dll) Version: 1.1.0+1263e8243dc2cd78095f678f813d7d9c52ea4315
C#
public static void Write<TSource>(
	IEnumerable<TSource> data,
	CsvWriter writer,
	CsvFrom<TSource> converter
)

Parameters

data  IEnumerableTSource
The data to write as CSV. Each item will be represented with a CSV row.
writer  CsvWriter
The CsvWriter used for writing.
converter  CsvFromTSource
An object that converts a TSource instance to a CSV row.

Type Parameters

TSource
Generic type parameter for the data type to write as CSV row.

Exceptions

ArgumentNullExceptiondata, or writer, or converter is null.
IOExceptionI/O error.
ObjectDisposedExceptionThe file was already closed.

See Also