I'd like to have two methods on my controller with the same name but the only difference being the parameter one takes a parameter of T and the other of List
[HttpPost]
public ActionResult Edit(myType parameter)
{
//snip
}
[HttpPost]
public ActionResult Edit(List<myType> parameter)
{
//snip
}
The framework is throwing an exception so I am guessing this isn't possible.
The current request for action 'Edit' on controller type 'MyController' is ambiguous between the following action methods:
I'm calling these methods from a jQuery ajax call, where data could be T or an array of T.
$.ajax({
url: url,
type: "POST",
contentType: "application/json, charset=utf-8",
dataType: "json",
data: JSON.stringify({ parameter: data }),
success: function () {
//success
},
error: function (e) {
//error
}
});