Skip to content
Andrew Bullock edited this page Jun 2, 2018 · 4 revisions

Areas exist to facilitate distinct separation of different parts of your application, typically defined by the Assets used.

Every Application needs a single Area, and should live under an Areas namespace within your project, for example:

~/areas/main

You need to implement AreaRegistrationBase within this namespace (this is important, as namespace reflection is used to wire everything up)

namespace ExampleProject.Areas.Main
{
    sealed class MainAreaRegistration : AreaRegistrationBase
    {
    }
}

Unless you want to do any custom route registrations, you dont need to any more code in the AreaRegistration than shown above.

You do need to register your area inside your IApplication's Configure() method, like this:

protected override void Configure()
{
	this.RegisterArea<MainAreaRegistration>();
}

The order of RegisterArea<T>() calls here is important, as the Routing for the Handlers inside the areas will be performed in the defined order.

TODO

Clone this wiki locally