ASP.NET MVC seems to be encouraging me to use hard-coded strings to refer to controllers and actions.
For example, in a controller:
return RedirectT
I know this is an old topic, but when I was looking for an answer for ASP.NET 5 this theme first appeared. There is no need to hardcode anymore, just use nameof
[HttpGet]
public IActionResult List()
{
...
return View();
}
[HttpPost]
public IActionResult Add()
{
...
return RedirectToAction(nameof(List));
}