logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class FoundationReferenceContracts

    The complete table of every cross-asset string reference (by Serenity Id or Guid) an IFoundationSettings asset can hold. It is DERIVED, not written: each row is a serialized string field carrying FoundationIdReferenceAttribute, read by FoundationReferenceFieldGraph from the field's own declaration — so the statement lives next to the field it describes, a new foundation type (the package's or an extender's) is covered by annotating its field, and a field nobody annotated is caught by the completeness ratchet over the shipped assets rather than by someone remembering to edit a second list.

    Consumers read this table and nothing else: the project validator and the adoption remapper walk it against real assets (FoundationReferenceWalker), Clone Directory re-points exactly the declared fields onto the clones, SerenityDiscoveryRegistry's id-contracts report is a projection of it, and GameSettingWiringMap looks its wiring targets up here.

    Inheritance
    object
    FoundationReferenceContracts
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Global.Application.References
    Assembly: Serenity.Global.Application.dll
    Syntax
    public static class FoundationReferenceContracts
    Remarks

    A string that is deliberately NOT a reference — a display name, a method name, a leftover key that happens to coincide with an asset's Id — carries no declaration; the shipped-content ratchet keeps the list of those coincidences, with a reason each. A polymorphic [SerializeReference] member is read as every concrete type it can hold, and a row reached that way applies only to an element of that type (ElementTypeFullName).

    Properties

    All

    Every declared reference row, across every owner type.

    Declaration
    public static IReadOnlyList<FoundationReferenceContract> All { get; }
    Property Value
    Type Description
    IReadOnlyList<FoundationReferenceContract>

    Methods

    ForOwnerType(string)

    Every row whose OwnerTypeName matches ownerTypeName exactly.

    Declaration
    public static IReadOnlyList<FoundationReferenceContract> ForOwnerType(string ownerTypeName)
    Parameters
    Type Name Description
    string ownerTypeName
    Returns
    Type Description
    IReadOnlyList<FoundationReferenceContract>

    ForOwnerTypeOrBase(IReadOnlyList<string>)

    Every row whose owner type name appears anywhere in ownerTypeNameChain — the concrete type first, then each base type — so a row declared against a shared base type still applies to every concrete subtype in the chain.

    Declaration
    public static IReadOnlyList<FoundationReferenceContract> ForOwnerTypeOrBase(IReadOnlyList<string> ownerTypeNameChain)
    Parameters
    Type Name Description
    IReadOnlyList<string> ownerTypeNameChain
    Returns
    Type Description
    IReadOnlyList<FoundationReferenceContract>

    FromDeclaration(FoundationStringField, FoundationIdReferenceAttribute)

    The row one FoundationIdReferenceAttribute on field declares.

    Declaration
    public static FoundationReferenceContract FromDeclaration(FoundationStringField field, FoundationIdReferenceAttribute declaration)
    Parameters
    Type Name Description
    FoundationStringField field
    FoundationIdReferenceAttribute declaration
    Returns
    Type Description
    FoundationReferenceContract
    In this article
    © 2026 Serenity. All Rights Reserved