Hi,
We have a website that deals with artists and venues and we're developing it in ASP.net MVC.
We have our artist views in a folder (Views/Artists/..), an ArtistsController, ArtistsRepository and adhere to the REST action names such as Show, New, Delete etc.
When we first mocked up the site, everything worked well in our test environment as our test URLs were /artists/Show/1209 but we need to change this so the website appears as /artists/Madonna and /artists/Foo-Fighters etc
However, how can we distinguish between valid artist names and the names of the actions for that controller?! For example, artists/PostComment or artists/DeleteComment? I need to allow the routing to handle this. Our default Show route is:
routes.MapRoute(
"ArtistDefault",
"artists/{artistName}",
new { controller = "Artists", action = "Show", artistName = ""}
One way around this is for our website to visibly run on /artists, but have our controller renamed to the singular - ArtistController - as opposed to ArtistsController. That would go against the naming conventions we went with when we started (but hey!).
Do you have any other recommendations? If possible we could also route depending on the verbs (so PostComment would be a POST so we could perhaps route to that action), but I'm not sure if that is advisable let alone possible.
Thanks