How do I use an Area in ASP.NET Core?
I have an app that needs an Admin section. This section requires its Views to be placed in that area. All request
Use this pattern in Configure method in Startup.Cs, as its full routing manner:
app.UseMvc(routes =>{
routes.MapRoute(
name: "MyArea",
template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");});
In Core 3.1 you should use below code in ConfigureServices method:
services.AddMvc(option => option.EnableEndpointRouting = false);