CsvWriterTSource(CsvWriter, CsvMapping, ActionTSource, Object) Constructor

Initializes a new CsvWriterTSource instance.

Definition

Namespace: FolkerKinzel.CsvTools.Mappings
Assembly: FolkerKinzel.CsvTools.Mappings (in FolkerKinzel.CsvTools.Mappings.dll) Version: 1.1.0+1263e8243dc2cd78095f678f813d7d9c52ea4315
C#
public CsvWriter(
	CsvWriter writer,
	CsvMapping mapping,
	Action<TSource, Object> conversion
)

Parameters

writer  CsvWriter
A CsvWriter instance.
mapping  CsvMapping
The CsvMapping used to convert TSource to CSV.
conversion  ActionTSource, Object

A method that fills the content of a TSource instance into the properties of mapping.

conversion is called with each call to Write(TSource) and it gets the TSource instance and mapping as arguments. The CsvMapping is passed to the method as dynamic argument: Inside the method the registered DynamicProperty instances can be used like regular .NET properties, but without IntelliSense ("late binding").

With each call all DynamicProperty instances in mapping have been reset to their DefaultValue.

Exceptions

ArgumentNullExceptionwriter, or mapping, or conversion is null.

See Also