Index ..."Async" action name in MVC 5

Viewed 232

I am not sure what is the correct way to use Async notation in MVC 5 views...

Suppose we have

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { action = "Index", id = UrlParameter.Optional }
    );
}

Let suppose at a point we updated the Home's Index action from

public ActionResult Index() { }

to

public async System.Threading.Tasks.Task<ActionResult> IndexAsync()

Should we rename the action as IndexAsync or better to let it as Index, because we should now rename all the hardcoded "Index" occurences in "IndexAsync" but as from the route we should redirect by default to the controller Index Action, but now Home Index is renamed in IndexAsync... What is the recommended practice here?

0 Answers
Related