I've added enums to my C# Entity Framework 6, MVC 4 application
. I like the approach as:
- I think my model is clear that the value comes from a lookup.
- I can easily bind them to a select list in my view using approached such as these: examples from Stack Overflow.
- I'm not looking up the database to get the values.
- I have less plumbing code to use the values.
On the downside, I'm thinking that:
- I need to be careful to keep my database in sync with my code for actual lookup tables.
- I guess, I would need to deploy the code every time I make a change to one, instead of perhaps having 'administration' tables where a user could add new lookup values. (I guess you could be selective and not use enums for values that would change a lot).
I'm just wondering what the real advantages of this approach are and if there are common scenarios when I would want to avoid it?
Thanks