Based on the code below, I'm able to call /api/cards and /api/cards/list but now /api/cards/1234567890
WebApiConfig
config.Routes.MapHttpRoute( _
name:="WithActionAndIdApi", _
routeTemplate:="api/{controller}/{action}/{id}", _
defaults:=New With {.id = RouteParameter.Optional} _
)
config.Routes.MapHttpRoute( _
name:="WithIdApi", _
routeTemplate:="api/{controller}/{id}" _
)
config.Routes.MapHttpRoute( _
name:="DefaultApi", _
routeTemplate:="api/{controller}", _
defaults:=New With {.action = "DefaultAction"} _
)
CardsController
<HttpPost()>
<ActionName("DefaultAction")>
Public Function PostValue(<FromBody()> ByVal value As Card_POST.Card) As HttpResponseMessage
<HttpPost()>
<ActionName("list")>
Public Function PostValue(<FromBody()> ByVal value As Cards_POST.CardList) As HttpResponseMessage
<HttpPut()>
Public Function PutValue(ByVal Id As String, <FromBody()> ByVal value As Card_PUT) As HttpResponseMessage