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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -