gbzhhu
asked on
ASP.NET Web API or MVC routing
Hi,
I am new to both MVC and ASP.NET Web API. I now have created a Web API project and everything is moving nicely except routing. I am used to writing web services where I name my methods as I like and they called easily by clients. Now I have a controller with
GetAllCustomers();
I need to add a
GetCustomersForShop(string key, int shopId);
But it keeps mapped to the GetAllCustomers(); method
http://xyz.com/Customer?key=abcd&shopId=2
I have not changed my routing in the web api config as I don't understand how that works. Can anyone help please
Cheers
H
I am new to both MVC and ASP.NET Web API. I now have created a Web API project and everything is moving nicely except routing. I am used to writing web services where I name my methods as I like and they called easily by clients. Now I have a controller with
GetAllCustomers();
I need to add a
GetCustomersForShop(string
But it keeps mapped to the GetAllCustomers(); method
http://xyz.com/Customer?key=abcd&shopId=2
I have not changed my routing in the web api config as I don't understand how that works. Can anyone help please
Cheers
H
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER