asp.net - Model a fixed list of options: enum, class or constants? -


i'm using asp.net , entityframework , trying model class "car" has property "category" category string fixed list of options, e.g. "new car", "oldtimer". display available categories in dropdown. not sure how model this:

enum: category string, guess enums don't work here, though perfect dropdown

constants: strings, inconvenient create drop down from

class property "name": seems convenient

is best practice use class?

yes, should use class model category. enums , constants may have trouble when doing queries cannot used directly when using linq, instance.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -