I'm creating an Api web project and wanted to put a set of methods on the same ControllerApi.
But in methods, I pass a Json object as a parameter. And since their structure is similar (see example), the controller is confused because it thinks they are all the same and so always calls the first method.
How can I resolve this?
Thank you in advance
Example:
public class MeuController : ApiCOntroller
{
public List<Series> ObterSeries (ParametroSeries parametros)
{ ... }
public List<Contas> ObterContas (ParametroContas parametros)
{ ... }
}
The call is being made as follows:
$.post("api/MeuController/ObterContas", { Identificacao: '12.234.567/0001-89' })
.done(function (data) { ... })
});
$.post("api/MeuController/ObterSeries", { Identificacao: '12.234.567/0001-89' })
.done(function (data) { ... })
});
Obs: Used json because there are other parameters that may or may not be informed