public static string UrlName(this Type controller)
{
var name = controller.Name;
return name.EndsWith("Controller") ? name.Substring(0, name.Length - 10) : name;
}
Then you can use:
Url.Action(nameof(ActionName), typeof(HomeController).UrlName())
浙公网安备 33010602011771号