Before we jump to custom routing, we will have to take a look at the basic changes in MVC6 from MVC5. ASP.NET MVC6 places all startup necessary services, defined and configured dependencies for the application, in a single file, Startup.cs. The Startup.cs file replaces all the functionality of global.asax where we put the middleware and configuration logic.
As we know, the routing actions are getting managed by the Routes.MapRoute method. In ASP.NET MVC 6 Routes.MapRoute, you won’t find this method as a part of Startup.cs file which now contains very few lines of code. You will also notice that there is no ad-hoc configuration file to take care of RouteConfig.cs, WebApiConfig.cs or other intermediate handlers recurrently shipped with the earlier ASP.NET versions and MVC pattern project templates. Startup.cs file has services.AddMvc() and services.UseMvc() methods to handle the routing action.