I want to implement a custom action in a Web API controller that takes multiple arguments with ASP.Net MVC 4 Web API framework.
public class APIRepositoryController : ApiController
{
...
[HttpGet, ActionName("retrieveObservationInfo")]
public ObservationInfo retrieveObservationInfo(
int id,
String name1,
String name2)
{
//...do something...
return ObservationInfo;
}
...
}
Such that I can call a URL in the web browser like:
"http://[myserver]/mysite/api/APIRepository/retrieveObservationInfo?id=xxx&name1=xxx&name2=xxx"
However, this has never worked.
Is there anything else I need to configure, e.g. WebAPI routing? Currently I just use the default WebApiConfig.cs.
Thanks in advance