WebAPIContrib icon indicating copy to clipboard operation
WebAPIContrib copied to clipboard

ShouldMapTo url parameters not being recognized

Open danrwhitcomb opened this issue 10 years ago • 2 comments

Right now I'm trying to pass multiple parameters to the action MyRecentActivity, but when I run the test below, an exception is thrown saying that the first parameter was 0, while it was expecting 1. This the method it should be mapping to:

public Result MyRecentActivity(int offset = 1, int limit = 15){}. 

Could you shed some light on the problem

const string url = "~/MobileServices/Dashboard/Tickets/my_recent_activity/1?limit=15";
url.ShouldMapTo<TicketsController>(x => x.MyRecentActivity(1, 15), "GET");

danrwhitcomb avatar Apr 10 '14 23:04 danrwhitcomb

@ChrisMissal or @pedroreys, any ideas?

panesofglass avatar May 15 '14 20:05 panesofglass

Let me take a look, I have a hunch that this might be related to how default arguments values are set on call site at compile time.

pedroreys avatar May 15 '14 20:05 pedroreys