MVC .NET Core Area
Here we look at the MVC .NET Core Area.
The MVC Area in .NET Core helps us to organise our folder structure of files, specifically the Models, Controllers and Views. So if you'd like to group certain Models, Views and Controllers into groups, as in parent folders, the .NET Core MVC Area facility allows us to do this whilst maintaining the functionality of the Models, Views and Controllers.
Add an MVC .NET Core Area
In order to get the Area working in .NET Core 3.1 I had to do the following in Startup.cs:
Note the .MapRazorPages call was only needed for ASP.NET Core Identity, so you may not need that, but hopefully useful if you do.
Additionally on the Controller I needed to added the [Area] attribute:
public class HomeController : Controller
private readonly ILogger
The file structure looks like this: