mperdeck / LINQtoCSV

Popular, easy to use library to read and write CSV files.
197 stars 112 forks source link

Feature Request: Add a "DefaultValue" decorator. #18

Open du8die opened 10 years ago

du8die commented 10 years ago

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; }

mperdeck commented 10 years ago

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