I am having trouble calling a method with a string parameter in asp.net core web api. The method doesn't get called or invoked.
** My Class looks like this **
[Route("api/[controller]")]
[ApiController]
public class MyClass : ControllerBase
{
[HttpGet("dispatch_discrepancies/{airwayBillNumber}")]
public List<Discrepancy> GetDispatchDiscrepancies(string airwayBillNumber)
{
....
}
}
Below is my route configuration.
app.UseMvc(routes => {
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});