aspnet / Templates

This repo is OBSOLETE - please see the README file for information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Templates should use app.UseMvcWithDefaultRoute();

Rick-Anderson opened this issue · comments

I recommend the templates use app.UseMvcWithDefaultRoute(); rather than

app.UseMvc(routes =>
{
    routes.MapRoute(
        name: "default",
        template: "{controller}/{action=Index}/{id?}");
});

The more complex code is a barrier to entry for new users who don't need this flexibility. Advanced users will have no problem adding the above code when they need it. The code above doesn't make much sense to Razor Pages developers. Recommend this change for all templates but especially for the Razor Pages template.

cc @DamianEdwards - part of the lower the barrier to entry effort.

This issue was moved to dotnet/templating#1180