Steps to reproduce:
- Create a new .NET Core Web API project
Head over to the generated
WeatherForecastController
, update the class to[ApiController] [Route("[controller]")] public class WeatherForecastController : ControllerBase { [HttpGet("{id}")] public async Task<ActionResult<object>> GetById(int id) { return Ok(null); } }
Create a second controller
[ApiController] [Route("[controller]")] public class FooController : ControllerBase { [HttpPost] public async Task<ActionResult<object>> Create() { return CreatedAtAction(nameof(WeatherForecastController.GetById), new { id = 1 }, null); } }
Build be project, it should be fine
Rider comes up with an error at the
Create
routeCannot resolve action 'GetById'
As you can see here
This is annoying because the IDE comes up with it in the project explorer too
Although the code works fine. So is my code bad and I should improve it? Is it a bug?