Last post Feb 23, 2015 08:27 PM by santhoshje
Feb 23, 2015 11:07 AM|kavithma_fdo|LINK
I have a controller call : LondonController which handles the request for
and if i wanted to add a new city to handle the request i add a new controller call : LiverpoolController etc .. and request for liverpool would be
problem is when ever i wanted to add a city i keep adding a new controller to handler it, is there any other way that i could write a default controller which handles any cities ?
so that i only need a one controller to handle different cities request ?
Feb 23, 2015 11:53 AM|kavithma_fdo|LINK
this is how my WebApiConfig.cs looks like
Feb 23, 2015 08:27 PM|santhoshje|LINK
Why don't you use default Web Api route and create a City controller?
public class CityController : ApiController
// GET: api/City/5
public string Get(int id)
// Based on id, you can return data corresponding to each city