I am using an ASP Webapi2 .net project
I am trying to write a controller that takes in a latitude, longitude and a timespan as parameters - which then returns some JSON data. (a bit like a store locator)
I have the following controller code
public dynamic Get(decimal lat, decimal lon)
{
return new string[] { lat.ToString(), lon.ToString()};
}
and I have put the following line at the top of my WebAPIConfig.cs class
config.Routes.MapHttpRoute(
name: "locationfinder",
routeTemplate: "api/{controller}/{lat:decimal}/{lon:decimal}"
);
When I do the following call I get a 404 error.
http://localhost:51590/api/MassTimes/0.11/0.22
Can I use decimals in the query string? how do i get around this?