FileHelpers icon indicating copy to clipboard operation
FileHelpers copied to clipboard

Input validation for [FieldOrder] attribute number range.

Open ashtonian opened this issue 10 years ago • 1 comments

I was in an application with FileHelpers and needed to introduce a field at the beginning of a record with file orders specified. In an attempt to be lazy/hacky I tried to introduce [FieldOrder( 0 )], to my surprise file helpers didn't throw an exception and I thought I was initially successful but soon realized I had other errors that seemed to be introduced by off by 1 issues. At which point I tried to enter negative numbers for giggles and it also allowed that. I also noticed that if a field order number is skipped it doesn't complain. I think input validation making sure that the numbers entered are in a sequence and are valid would be nice?

ashtonian avatar Aug 21 '15 20:08 ashtonian

Hi @Ashtonian in fact it must work like you describe in FieldOrder(0) I will check that.

About secuencial and negative is intended to work that way that you can add FieldOrder 10, 20,30 etc with no secuence to allow easy changes

Thanks for feedback

MarcosMeli avatar Aug 24 '15 14:08 MarcosMeli