Deveel.Data.Sql.Tables.ConstraintInfo.ForeignKey C# (CSharp) Méthode

ForeignKey() public static méthode

public static ForeignKey ( string constraintName, ObjectName tableName, string columnNames, ObjectName refTable, string refColumns ) : ConstraintInfo
constraintName string
tableName ObjectName
columnNames string
refTable ObjectName
refColumns string
Résultat ConstraintInfo
        public static ConstraintInfo ForeignKey(string constraintName, ObjectName tableName, string[] columnNames,
			ObjectName refTable, string[] refColumns)
        {
            if (tableName == null)
                throw new ArgumentNullException("tableName");
            if (refTable == null)
                throw new ArgumentNullException("refTable");
            if (columnNames == null || columnNames.Length == 0)
                throw new ArgumentException("At least one column is required", "columnNames");
            if (refColumns == null || refColumns.Length == 0)
                throw new ArgumentException("At least one referenced column is required.", "refColumns");

            if (columnNames.Length != refColumns.Length)
                throw new ArgumentException("The number of columns in the constraint must match the number of columns referenced.");

            var constraint = new ConstraintInfo(constraintName, ConstraintType.ForeignKey, tableName, columnNames);
            constraint.ForeignTable = refTable;
            constraint.ForeignColumnNames = refColumns;
            return constraint;
        }

Same methods

ConstraintInfo::ForeignKey ( ObjectName tableName, string columnName, ObjectName refTable, string refColumn ) : ConstraintInfo