Got an app that makes Get requests with some parameters to my old api now I want to make a new api using .Net MVC6 but I cannot change all the clients for them to use a different Uri.
I need to make my new api compatible with those kind of requests.The query style is this: localhost/api/locations?location[lat]=12&location[lng]=21
public class Location
{
public string lat;
public string lng;
}
[Route("api/[controller]")]
public class LocationsController : Controller
{
[HttpGet]
public ActionResult Get(Location loc)
{
var av= new CreatedAtActionResult("","",null,null);
return av;
}
}
My question is, how can I bind this "kind" of query to the parameter?