Key attribute

API Reference: KeyAttribute Class

The KeyAttribute can be applied to page models, sections, content models, and content properties. The attribute specifies the unique key of the object for data storage.


Decorate the model class or property with the KeyAttribute. Pass the key in the attribute constructor.

Default Convention

If KeyAttribute is not specified, the object identifier will be used as unique key.


public class RssFeed: IPageModel
    public SeoContent Seo { get; set; }

    // Key will be 'MyNamespace.RssFeed.SecondParagraph' by convention
    public ParagraphContent SecondParagraph { get; set; }