I'm experiencing an issue in my angular application when trying to call an API method from angular. The method requires two parameters - one integer value and one string value, which is optional.
Below is the code snippet in Typescript:
let id:number = 5;
let value: string = "";
this.http.get<string[]>(this.appService.baseUrl + 'api/File/' + id + "/" + value)
In the Controller:
[HttpGet("{id:int}/value")]
[ResponseCache(NoStore = true)]
public async Task<IActionResult> Get(int id, string value) { }
The issue arises because the Get method is not being called when the value parameter is empty.