Class ForeignKeyAttribute
- Namespace
- Typhon.Schema.Definition
- Assembly
- Typhon.Schema.Definition.dll
Declares a component field as a foreign key referencing another component type, enabling FK validation and cascade-on-delete behavior (see OnParentDelete).
[AttributeUsage(AttributeTargets.Field)]
public sealed class ForeignKeyAttribute : Attribute
- Inheritance
-
ForeignKeyAttribute
- Inherited Members
Constructors
ForeignKeyAttribute(Type)
Declares a foreign key referencing targetComponentType.
public ForeignKeyAttribute(Type targetComponentType)
Parameters
targetComponentTypeTypeThe referenced component type (see TargetComponentType).
Exceptions
- ArgumentNullException
targetComponentTypeisnull.
Properties
TargetComponentType
The component type this foreign key references.
public Type TargetComponentType { get; }