I'm new to C# and by extension, Rider and this is quite strange to me.
I have a controller with several mappings - only showing the first one, but the problem is the same for all of them.
The application works fine, each of the individual endpoints does its job as expected when triggered by Postman, but for some reason the method names are greyed out and Rider keeps suggesting removing them because they are "unused".
{
[ApiController]
[Route("")]
public class HomeController
{
private readonly IToDoService _toDoService;
public HomeController(IToDoService toDoService)
{
_toDoService = toDoService;
}
[HttpGet("")]
[HttpGet("/list")]
public ActionResult<List<ToDo>> ShowTodos()
{
var todos = _toDoService.GetAllToDos();
return todos;
}
Any ideas on how to force Rider to recognize the methods and remove related warnings? Thanks in advance.