CsvDefaultAttribute(object)
Added in v34.0.0
public CsvDefaultAttribute(object? value)Gives the member value when its field is empty.
Parameters
valueobject?- The value of an empty field.
Attribute in CsvHelper
The value that an empty field gives a member of a CsvRecordAttribute type, instead of a FormatException for a number, null for a Nullable<T> or "" for a string.
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public sealed class CsvDefaultAttribute : AttributeCsvHelperCsvHelper.dllThe value must be a constant that converts implicitly to the member's type, or null for a reference type or a Nullable<T>. A column that is missing from the header is a different case, which CsvColumnAttribute.Optional handles.
public CsvDefaultAttribute(object? value)Gives the member value when its field is empty.
valueobject?public object? Value { get; }The value of an empty field.