Enum RelationshipKind
The cardinality of a declared navigation relationship.
public enum RelationshipKind
- Extension Methods
Fields
ManyToMany = 3Two collection navigations joined through a junction. Represented by the model but not creatable through the slice-A fluent API; loading it is rejected in a later slice.
ManyToOne = 1A reference navigation on the dependent side, for example
Child.Parent. The foreign key lives on the declaring (dependent) type.OneToMany = 0A collection navigation on the principal side, for example
Parent.Children. The foreign key lives on the related (dependent) type.OneToOne = 2A reference navigation whose foreign key is unique. The uniqueness is a declaration-time trust: the core neither inspects the schema or the data nor imposes a uniqueness constraint, and a non-unique foreign key is accepted when the metadata is built. The only guard is per parent at load time: two distinct non-null child identities for one parent throw InvalidOperationException at materialization, while repeated identical rows and keyless/null-identity repeats are tolerated (the first child wins). Declarable through the fluent
HasOneToOneor the model.
Remarks
A relationship is declared explicitly on both sides (fluent HasMany/HasOne or
RelationshipAttribute); the kind is derived from the navigation shape
(collection or reference) and is not inferred from conventions.