I am using attribute routing.
Here is my controller:
[HttpGet("Flights/{Id?}")]
public IActionResult GetFlights(string Id)
{
var flightroute= _myService.GetFlightsWithRoutes(Id);
if (flightroute != null)
{
return Ok(flightroute);
}
return NotFound();
}
I able to perform
https://localhost:44374/air/Flights/AI-109
But this shows 404 Not Found response
https://localhost:44374/air/Flights?Id=AI-109
How can I enable both routing, or can I? I want both routes to call same action method.