Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CheckConstraint() [2/2]

override void System.Data.UniqueConstraint.CheckConstraint ( DataRow row,
DataRowAction action )
inlinepackage

Definition at line 220 of file UniqueConstraint.cs.

221 {
223 {
224 return;
225 }
226 switch (action)
227 {
228 case DataRowAction.Rollback:
229 if (row._tempRecord == -1)
230 {
231 break;
232 }
233 goto case DataRowAction.Change;
234 case DataRowAction.Change:
235 case DataRowAction.Add:
236 if (row.HaveValuesChanged(ColumnsReference) && ConstraintIndex.IsKeyRecordInIndex(row.GetDefaultRecord()))
237 {
238 object[] columnValues = row.GetColumnValues(ColumnsReference);
239 throw ExceptionBuilder.ConstraintViolation(ColumnsReference, columnValues);
240 }
241 break;
242 }
243 }
bool IsKeyRecordInIndex(int record)
Definition Index.cs:725

References System.Data.DataRow._tempRecord, System.action, System.Data.UniqueConstraint.ColumnsReference, System.Data.UniqueConstraint.ConstraintIndex, System.Data.ExceptionBuilder.ConstraintViolation(), System.Data.DataTable.EnforceConstraints, System.Data.DataRow.GetColumnValues(), System.Data.DataRow.GetDefaultRecord(), System.Data.DataRow.HaveValuesChanged(), System.Data.Index.IsKeyRecordInIndex(), and System.Data.UniqueConstraint.Table.