Link to home
Start Free TrialLog in
Avatar of gbzhhu
gbzhhuFlag for United Kingdom of Great Britain and Northern Ireland

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
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gbzhhu

ASKER

Thank you.  That sorted it