logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class FoundationReferenceContract

    One declarative row describing a single cross-asset string reference an IFoundationSettings owner type holds: which serialized property carries it, whether the stored value is a Serenity Id or Guid (or the owner's own post-rename Id, for a self-reference like UiOption.ViewId), which settings type the value must resolve against, and how the value's shape must be treated when it is read or rewritten. See FoundationReferenceContracts for the full table this feeds.

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

    Constructors

    FoundationReferenceContract(string, string, FoundationReferenceKind, string, string, FoundationReferenceSelector, FoundationReferenceShape, string)

    Declaration
    public FoundationReferenceContract(string ownerTypeName, string propertyPath, FoundationReferenceKind kind, string referencedTypeName, string referencedTypeNamePropertyPath, FoundationReferenceSelector selector, FoundationReferenceShape shape, string documentation)
    Parameters
    Type Name Description
    string ownerTypeName
    string propertyPath
    FoundationReferenceKind kind
    string referencedTypeName
    string referencedTypeNamePropertyPath
    FoundationReferenceSelector selector
    FoundationReferenceShape shape
    string documentation

    Properties

    Documentation

    Declaration
    public string Documentation { get; }
    Property Value
    Type Description
    string

    Why this reference exists — surfaced to an authoring agent through the discovery registry.

    Kind

    Declaration
    public FoundationReferenceKind Kind { get; }
    Property Value
    Type Description
    FoundationReferenceKind

    What kind of value the property stores.

    OwnerTypeName

    Declaration
    public string OwnerTypeName { get; }
    Property Value
    Type Description
    string

    Short (non-namespaced) type name of the IFoundationSettings owner this row describes.

    PropertyPath

    Declaration
    public string PropertyPath { get; }
    Property Value
    Type Description
    string

    Serialized property path on the owner, resolved segment by segment via SerializedObject.FindProperty/SerializedProperty.FindPropertyRelative. A segment written Foo[] marks a collection element, expanded into Foo.Array.data[N] for every element the collection holds.

    ReferencedTypeName

    Declaration
    public string ReferencedTypeName { get; }
    Property Value
    Type Description
    string

    Short type name the value must resolve against, or null when ReferencedTypeNamePropertyPath supplies it instead, or when any IFoundationSettings type is acceptable.

    ReferencedTypeNamePropertyPath

    Declaration
    public string ReferencedTypeNamePropertyPath { get; }
    Property Value
    Type Description
    string

    Path to a sibling string field on the OWNER (not the collection element) that names the referenced type at authoring time — e.g. UnityGameSettingsDefinition.selectableValueTypeName for its own Options/DefaultValue. Null when ReferencedTypeName is fixed.

    Selector

    Declaration
    public FoundationReferenceSelector Selector { get; }
    Property Value
    Type Description
    FoundationReferenceSelector

    Which run-time condition on the owning asset decides whether this row applies to a given element.

    Shape

    Declaration
    public FoundationReferenceShape Shape { get; }
    Property Value
    Type Description
    FoundationReferenceShape

    How the stored value must be interpreted when it is read or rewritten.

    Methods

    AssetKeyReference(string, string, string)

    Declares a row whose value is another asset's Addressables load key (its address) — see AssetKeyReferenceContracts, which synthesises one of these per concrete [AssetPathField] site rather than declaring a fixed row here.

    Declaration
    public static FoundationReferenceContract AssetKeyReference(string ownerTypeName, string propertyPath, string documentation)
    Parameters
    Type Name Description
    string ownerTypeName
    string propertyPath
    string documentation
    Returns
    Type Description
    FoundationReferenceContract

    GuidReference(string, string, string, FoundationReferenceSelector, string, string, FoundationReferenceShape)

    Declares a row whose value is another asset's Guid.

    Declaration
    public static FoundationReferenceContract GuidReference(string ownerTypeName, string propertyPath, string referencedTypeName, FoundationReferenceSelector selector, string documentation, string referencedTypeNamePropertyPath = null, FoundationReferenceShape shape = FoundationReferenceShape.Plain)
    Parameters
    Type Name Description
    string ownerTypeName
    string propertyPath
    string referencedTypeName
    FoundationReferenceSelector selector
    string documentation
    string referencedTypeNamePropertyPath
    FoundationReferenceShape shape
    Returns
    Type Description
    FoundationReferenceContract

    IdReference(string, string, string, FoundationReferenceSelector, string, string, FoundationReferenceShape)

    Declares a row whose value is another asset's Id.

    Declaration
    public static FoundationReferenceContract IdReference(string ownerTypeName, string propertyPath, string referencedTypeName, FoundationReferenceSelector selector, string documentation, string referencedTypeNamePropertyPath = null, FoundationReferenceShape shape = FoundationReferenceShape.Plain)
    Parameters
    Type Name Description
    string ownerTypeName
    string propertyPath
    string referencedTypeName
    FoundationReferenceSelector selector
    string documentation
    string referencedTypeNamePropertyPath
    FoundationReferenceShape shape
    Returns
    Type Description
    FoundationReferenceContract

    OwnerIdReference(string, string, string)

    Declares a self-reference row: the value is the OWNER's own Id, rewritten to its post-rename value.

    Declaration
    public static FoundationReferenceContract OwnerIdReference(string ownerTypeName, string propertyPath, string documentation)
    Parameters
    Type Name Description
    string ownerTypeName
    string propertyPath
    string documentation
    Returns
    Type Description
    FoundationReferenceContract
    In this article
    © 2026 Serenity. All Rights Reserved