field of an enum start by 2 instead of 0? I'm using a third party ksp parser that uses the ordinal for something that I need to skip the first three numbers for...
j
Joffrey
12/13/2022, 4:22 PM
Could you please elaborate? What is the 3rd party parser using the ordinal for? Couldn't it be a property instead?
There's either using the enum name or the ordinal for the fields value in the database... and the field's value starts from 2
j
Joffrey
12/13/2022, 4:24 PM
Ouch.. that looks wrong from a DB evolution standpoint. Both strategies look pretty bad: using the name is sensitive to renaming, and using the ordinal is sensitive to re-ordering or addition of values in the middle.
I wonder why they don't have a property-based strategy, which would be more robust
👍 2
👍🏼 1
d
dave08
12/13/2022, 4:25 PM
Yeah... they have mappers and converters... but it was easier to write a value class wrapper that translates between the value and the enum...