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

IDataFiles Pennington.Data

Typed, name-keyed access to data files registered with AddDataFile. Data files reload automatically when the underlying file changes on disk.

Properties

Names IEnumerable<string>
The names of all registered data files.

Methods

Get<T>

#
public T Get<T>(string name)

Retrieves the loaded value for the data file registered under name.

Parameters

name string
Logical name supplied when the data file was registered.

Returns

T

TryGet<T>

#
public bool TryGet<T>(string name, out T value)

Tries to retrieve the loaded value for the data file registered under name. Returns false when no data file is registered with that name OR when the registered type does not match T.

Parameters

name string
Logical name supplied when the data file was registered.
value ref T
The loaded value when the lookup succeeds.

Returns

bool

Pennington.Data.IDataFiles

namespace Pennington.Data;

/// Typed, name-keyed access to data files registered with AddDataFile. Data files reload automatically when the underlying file changes on disk.
public interface IDataFiles
{
    /// Retrieves the loaded value for the data file registered under name.
    
public T Get<T>(string name)
; /// The names of all registered data files.
public IEnumerable<string> Names { get; }
/// Tries to retrieve the loaded value for the data file registered under name. Returns false when no data file is registered with that name OR when the registered type does not match T.
public bool TryGet<T>(string name, out T value)
; }