I have two methods in my api controller with same name and same number of parameters but the type of one of the parameter is different. You can see here
[HttpGet]
public dynamic Add(String organizationId, Driving driving)
[HttpGet]
public dynamic Add(String organizationId, bool driving)
I am trying to call the api like this
var data {organizationId: "something", driving: true };
var ajaxConfig = {
url: some url,
type: "GET",
dataType: 'json',
crossDomain: true,
success: function (data) {
onDone();
callback(data);
},
error: function (error, textStatus, errorThrown) {
}
};
ajaxConfig.data = data;
$.ajax(ajaxConfig);
The system gets confused between which api to call. Am I doing it wrong? Is there some other way to do it?