LINQtoCSV icon indicating copy to clipboard operation
LINQtoCSV copied to clipboard

Feature Request: Add a "DefaultValue" decorator.

Open du8die opened this issue 11 years ago • 1 comments

For example, when an expected integer value contains no value ("") a WrongDataFormatException is thrown.

Can a "DefaultValue" decorator be added, where, when a NoValue is encountered, instead of throwing the exception, a default value could be specified?

[CsvColumn(DefaultValue = -1)] public int SomeProperty { get; set; }

du8die avatar May 17 '14 11:05 du8die

I can see the business case for this. If you decide to go ahead and build this, please send me a pull request.

mperdeck avatar May 19 '14 12:05 mperdeck