Reputation: 4562
I've added enums to my C# Entity Framework 6, MVC 4 application
. I like the approach as:
On the downside, I'm thinking that:
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
Upvotes: 2
Views: 356
Reputation: 82136
I don't think your question is related to EF at all, it's more backend-agnostic.
The only real problem is what you have already suggested - having to recompile when you need to add/remove values. However, that all really depends on how often you actually expect the list to change.
The point of using an enum
is for readability & simplicity from the developers perspective, however, if you enum
is really just for UI purposes I'd argue that you could end up giving the developer more work in maintaining the list than doing a lot of work once and not having to worry about it again.
Having to re-compile just for the sake of adding a new option for a user seems very brittle to me.
Upvotes: 1