Dividing web applications into multiple Areas
Sometimes, when working with larger web applications, it can be interesting to logically separate them into multiple smaller, functional units. Each unit can then have its own controllers, views, and models, which makes it easier to understand, manage, evolve, and maintain them over time.
ASP.NET Core 2.0 provides some simple mechanisms based on the folder structure for dividing web applications into multiple functional units, also called Areas.
For example, to separate the standard Area from the more advanced administration Area within your applications. The standard Area could then even enable anonymous access on some pages, while asking for authentication and authorization on others, whereas the administration Area would always require authentication and authorization on all pages.
The following conventions and restrictions apply to Areas:
- An Area is a subdirectory under the
Areas
folder - An Area contains at least the two subfolders:Â
Controllers...