Can someone explain why POST call to the following actions is ambiguous? They have different set of parameters?
[RequireRequestValueAttribute("setID")]
public ActionResult Add(int setID){}
[HttpPost]
public ActionResult Add(TypeModel model, int? queueID) {}
The issue only occurs when using the RequireRequestValueAttribute attribute, which I am using because I wanted to add another method for a Get call with different set of parameters.
Following is the implementation of that that I am using, found on another stackoverflow question:
public class RequireRequestValueAttribute : ActionMethodSelectorAttribute
{
public RequireRequestValueAttribute(string valueName)
{
ValueName = valueName;
}
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo)
{
return (controllerContext.HttpContext.Request[ValueName] != null);
}
public string ValueName { get; private set; }
}