Open MarcoGaribaldi opened 5 years ago
Hi!
ASP.NET Core API controllers allow to inject interfaces into a controller method as in the following example:
public async Task<IActionResult> GetEmployeeAsync([FromServices] IGetEmployeeServiceAsync service, [FromQuery] int id)
I want to skip the service parameter when generating an Angular data service. I have managed to resolve the matter this way:
$Methods[ public $name = ($Parameters(p => p.Name != "service")[$name: $Type][, ]) : ng.IHttpPromise<$ReturnType> => { return this.$http<$ReturnType>({ url: '$ApiUrl', method: '$HttpMethod', data: $RequestData }); } ]
It works but it is not robust enough, as it relies on the fact that the parameter is named service. Is there a better way to skip parameters of type interface?
Hi!
ASP.NET Core API controllers allow to inject interfaces into a controller method as in the following example:
public async Task<IActionResult> GetEmployeeAsync([FromServices] IGetEmployeeServiceAsync service, [FromQuery] int id)
I want to skip the service parameter when generating an Angular data service. I have managed to resolve the matter this way:
It works but it is not robust enough, as it relies on the fact that the parameter is named service. Is there a better way to skip parameters of type interface?