This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

ContentRecordRegistry Pennington.Content

Aggregates the ContentRecords projected by every registered IContentService into a snapshot keyed by canonical path, so consumers can resolve the typed front matter for a route without re-walking the services. Registered via AddFileWatched<ContentRecordRegistry>() so the table is dropped when any service's source changes.

Search faceting and structured-data emission both join the rendered corpus back to its records through this registry: the route a page was served at resolves to the Metadata that carries its capabilities (IHasSearchFacets, IHasStructuredData, ...).

Constructors

ContentRecordRegistry

#
public ContentRecordRegistry(IEnumerable<IContentService> contentServices)

Creates a registry that lazily aggregates records across all registered content services.

Parameters

contentServices IEnumerable<IContentService>

Methods

GetSnapshotAsync

#
public Task<FrozenDictionary<string, ContentRecord>> GetSnapshotAsync()

Returns the aggregated record snapshot keyed by canonical path with slashes trimmed — matching SiteProjection's route key so the two join cleanly. Materializes on first call; dropped on file-watch invalidation so the next access rebuilds.

Returns

Task<FrozenDictionary<string, ContentRecord>>

OnFileChanged

#
public FileWatchResponse OnFileChanged(FileChangeNotification change)

Called on the file-watcher thread for every watched change. Must be quick and thread-safe.

Parameters

change FileChangeNotification

Returns

FileWatchResponse

Pennington.Content.ContentRecordRegistry

namespace Pennington.Content;

/// Aggregates the ContentRecords projected by every registered IContentService into a snapshot keyed by canonical path, so consumers can resolve the typed front matter for a route without re-walking the services. Registered via AddFileWatched<ContentRecordRegistry>() so the table is dropped when any service's source changes. Search faceting and structured-data emission both join the rendered corpus back to its records through this registry: the route a page was served at resolves to the Metadata that carries its capabilities (IHasSearchFacets, IHasStructuredData, ...).
public class ContentRecordRegistry
{
    /// Creates a registry that lazily aggregates records across all registered content services.
    
public ContentRecordRegistry(IEnumerable<IContentService> contentServices)
; /// Returns the aggregated record snapshot keyed by canonical path with slashes trimmed — matching SiteProjection's route key so the two join cleanly. Materializes on first call; dropped on file-watch invalidation so the next access rebuilds.
public Task<FrozenDictionary<string, ContentRecord>> GetSnapshotAsync()
; /// Called on the file-watcher thread for every watched change. Must be quick and thread-safe.
public FileWatchResponse OnFileChanged(FileChangeNotification change)
; }