Entity DbSet Relationships

Entity DbSet Relationships

The Asterisk 2 documentation tree relies on strict Entity Framework Core foreign key mapping schemas to track project networks. The architecture implements strong parent-child associations ensuring clear document rendering across client interfaces.


Content Navigation Storage Matrix

The flow chart below illustrates how relational document nodes map downward from global projects into single page contents:

graph LR
    %% Master Node
    subgraph LevelRoot["Project Root Definition"]
        E_Proj["Project Entity Class<br/>(List&lt;Section&gt; Sections)"]
    end

    %% Intermediate Node
    subgraph LevelSection["Categorized Module Scope"]
        E_Sec["Section Entity Class<br/>(List&lt;Page&gt; Pages)"]
    end

    %% Leaf Contents
    subgraph LevelPage["Content Leaf Nodes"]
        E_Page["Page Entity Class<br/>(Content string, Order index)"]
        E_Sub["Recursive SubPage Arrays<br/>(List&lt;Page&gt; SubPages)"]
    end

    %% Links
    E_Proj ==>|"Navigation Includes"| E_Sec
    E_Sec ==>|"Eager Loaded Leaves"| E_Page
    E_Page ==>|"Lazy / Explicit Resolvers"| E_Sub

    %% Color Mapping
    classDef rootToken fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#fff,rx:6px,ry:6px;
    classDef secToken fill:#1e293b,stroke:#a855f7,stroke-width:2px,color:#fff,rx:6px,ry:6px;
    classDef pageToken fill:#312e81,stroke:#ec4899,stroke-width:2px,color:#fff,rx:6px,ry:6px;

    class LevelRoot,E_Proj rootToken;
    class LevelSection,E_Sec secToken;
    class LevelPage,E_Page,E_Sub pageToken;

Detailed Model Field Specifications

1. Project Entity Mappings

  • Id (int): Primary automatic auto-increment identity integer.
  • Slug (string): Unique URL-friendly string identifier enforced by database indices.
  • Sections: Virtual navigational collection representing associated documentation categories.

2. Section Entity Mappings

  • ProjectId (int): Mandatory foreign key associating the category to its top-level owner.
  • Pages: Navigational tracking lists sorting top-level document documents.

3. Page Entity Mappings

  • SectionId (int): Foreign key anchoring leaf records to their parent module.
  • ParentPageId (int?): Nullable hierarchical self-reference foreign key supporting multi-level document trees.
  • Content (string): Unrestricted storage text columns retaining compiled Markdown instructions.