My requirement is to be able to accept the following combinations
{Part1}/{Controller}/{Action}
{Part1}/{Part2}/{Controller}/{Action}
{Part1}/{Part2}/{Part3}/{Controller}/{Action}
and pass them into controllers and methods that will convert Parts 1 to 3 into an ID that is used all over the system. The scheme is:
string id = part1 + "-" + part2 + "-" + part3
The routes are organized in that way to give the appearance of a folder structure, and the controllers / actions are what's available for those "folders".
I'd like to come up with a way of doing this adhering to DRY.
I'm thinking perhaps this is an Action Filter (which I will apply universally) that creates a new entry ID into the RouteValueDictionary, taking the value from the presence of Parts 1 to 3.
Is this the right approach or is there a better solution?
Thank you.