An Area represents a whole section within NLess.IO like Content, Media, etc.
On permissions perspective, every area can be protected for being used or can grant access to users or groups. Use the UserAuthorizedForAreaFilter attribute.
[UserAuthorizedForAreaFilter(AreaId = "308a5393-4020-4d0a-b2c4-74adcc22cc61")] public class ContentController : Controller { }
Every area has it's own class that derives from IArea which is registered in services.
services.AddSingleton<IArea, ContentArea>();
Eg.
public class ContentArea : IArea { public string ReactJsIdentifier { get; set; } = "content-view"; public string Group { get; set; } = "General"; public string Name { get; set; } = "Content"; public Guid Id { get; set; } = Guid.Parse("308a5393-4020-4d0a-b2c4-74adcc22cc61"); }
ReactJsIdentifier
The rendering for the areas are using this identifier to set a class name for the area content.
Group
The group can be one of the existing or a new one. It's only for logical grouping in the sidebar.
Name
The name is the readable label for the sidebar entry.
Id
The Id must be unique. The Id is neccessary on the connection to a Action-Controller in relation of permissions.
To set the area in the correct order. Register service before or after another registered IArea.