Name
Rule
Synopsis
This enumeration is used to specify two properties of the
ForeignKeyConstraint class:
ForeignKeyConstraint.UpdateRule and
ForeignKeyConstraint.DeleteRule. The value from
this enumeration indicates what will happen to the related child rows
when a change is made to a parent row. For example, by using a
ForeignKeyConstraint.DeleteRule or
Cascade, all child rows are removed when the
parent row is deleted. If you use SetNull, the
foreign key field in the child record is set to a
null value. SetDefault restores
the default value for the foreign key field; None
performs no action.
public enum Rule { None = 0, Cascade = 1, SetNull = 2, SetDefault = 3 }
Hierarchy
System.Object
→
System.ValueType
→
System.Enum(System.IComparable, System.IFormattable, System.IConvertible)
→
Rule
Returned By
ForeignKeyConstraint.{DeleteRule, UpdateRule}
Passed To
ForeignKeyConstraint.{DeleteRule, ForeignKeyConstraint( ), UpdateRule}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access