I've defined an Enum as part of the model objects for an ASP.NET MVC application.
The Enum is called 'ContentTypes' and looks something like this:
public enum ContentTypes
{
[Description("News story")]
NewsStory = 1,
[Description("Article")]
Article = 2
}
Now I'm planning to add another set of attributes to the enum items called 'Route'. This attribute will allow me to map each ContentType to an URL that can handle it.
So after this I'll have:
public enum ContentTypes
{
[Description("News story")]
[Route("news/item/{URLName}")]
NewsStory = 1,
[Description("Article")]
[Route("article/item/{URLName}")]
Article = 2
}
Do you think the enum is getting too heavy-weight at this point?
Would it be better to break the enum items into, say, classes, and then give each class a 'Description' and 'Route' attribute?