Possible Duplicate:
Routing with Multiple Parameters using ASP.NET MVC
Experimenting with the MVC4 web api, I defined the following route, in Global.asax
routes.MapRoute(
name:="API Default",
url:="api/{systemid}/{controller}/{id}",
defaults:=New With {.id = RouteParameter.Optional}
)
I changed the controller accordingly
Public Class ValuesController
Inherits ApiController
Public Function GetValues(systemid As Integer) As IEnumerable(Of String)
---
End Function
Public Function GetValue(systemid As Integer, ByVal id As Integer) As String
---
End Function
End Class
I was looking to format requests uri like
http://localhost/api/13/values/5
but the only working call is with explicit parameters, as to
http://localhost/api/values?id=5&systemid=4
Is there a way to accomplish what I was looking for?