CsvRecordExtensionFillWith(CsvRecord, IEnumerableString, Boolean) Method

Fills record with the items of a String collection.

Definition

Namespace: FolkerKinzel.CsvTools
Assembly: FolkerKinzel.CsvTools (in FolkerKinzel.CsvTools.dll) Version: 2.0.1+2345335399184346d9b2cc992ed5c814406052c1
C#
public static void FillWith(
	this CsvRecord record,
	IEnumerable<string?>? data,
	bool resetExcess = true
)

Parameters

record  CsvRecord
The CsvRecord instance to be filled.
data  IEnumerableString
The Strings with which to fill record. The argument may be null or may contain null values.
resetExcess  Boolean  (Optional)

If data has fewer items than record fields and this parameter is true, the surplus fields in record will be reset to the default value .

For performance reasons this parameter can be set to false when writing CSV because WriteRecord resets all fields in record.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CsvRecord. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionrecord is null.
ArgumentOutOfRangeExceptiondata contains more items than record.

See Also