Reputation: 5058
I have MVC app with really lot of enumerations. What would be the best practise for organizing enumeration inside MVC project. Inside model class, create separate class for enums, ...?
Upvotes: 1
Views: 1177
Reputation: 124756
MVC isn't really any different from any other .NET technology in this respect.
In general, there's no need to nest enums inside a class - just put them into a suitable namespace that's related to their purpose. If the purpose is limited to one or a few classes, put it in the same namespace and project as these classes.
If an enum is only ever used by a single class, you could nest the enum type in the class, but there's little benefit.
Upvotes: 1