I’m playing around with Raven DB and MVC 2.
By default, the id in Raven will be e.g. “suggestions/1234” for an entity called Suggestion.
This causes problems with routing when I write like this:
<%: Url.Action("Delete", "Suggestion", new { id = suggestion.Id }) %>
The url will be /Suggestion/Delete/suggestions/14337 which won’t work.
Can this be solved in the routing, or do I have to change the format of the id in Raven? And how do I do that?
Change your route from
{controller}/{action}/{id}to{controller}/{action}/{*id}. This is called a “catch-all” route; more details on MSDN.Alternatively, you could pass the
idas a query parameter.