Startup种;
1、在ConfigureServices方法中添加服务:
services.AddMvc(p => p.EnableEndpointRouting = false);
2、在Configure中添加配置:
app.UseMvcWithDefaultRoute();