suppose I have 3 categories 1, 2, 3 named fruit, vegetable and grain.
Right now I have domain.com/category/1 which would take me to fruit's page and so on...
Now I would like to domain.com/category/fruit to take me to fruit's page because that looks nicer and categories are very few like 3 or 4 max... so I don't plan on looking at database to see what categoryid refers to what name.
Should I just use a global enum/array? (any examples?)
It just seemed weird, because I have a dropdown that lists all the categories and I look at the selected integer value of the category (assume 1) and pass it on to Category ActionResult and then the actionresult looks at "fruit" and then converts it back to 1... so I am going back and forth just so that URL would look nice, which makes me wonder if I should do some kind of URL routing in global.asax for this?
Or maybe I should use web.config to declare fruit = 1 and so on...?
There are several ways to do this I guess, but I want to know the most efficient way.