I have some problems with creating two actions with the same name but 1 have a parameter and the other one not, I always get the this error:
ERROR:
AmbiguousActionException: Multiple actions matched. The following actions matched route data and had all constraints satisfied:
These are my actions:
public IActionResult Skills(string skill)
{
return View("SkillDetails");
}
public IActionResult Skills()
{
return View("Skills");
}
These are my routes:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "WithSkill",
template: "Home/Skills/{skill}");
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});