internal ColumnConstraint(string constraintTableName, string constraintColumnName, IPredicateExpression predicateExpression, PredicateExpressionOperator operatorToUse) { this.predicateExpression = predicateExpression; if (string.IsNullOrEmpty(constraintTableName)) throw new QueryGenerationException("Cannot create a constraint without a table"); if (string.IsNullOrEmpty(constraintColumnName)) throw new QueryGenerationException("Cannot create a constraint without a column"); this.ColumnName = constraintColumnName; this.TableName = constraintTableName; this.Parameters = new List<IDataParameter>(); if (operatorToUse == PredicateExpressionOperator.And) predicateExpression.And(this); else predicateExpression.Or(this); }
internal ColumnConstraint(IColumn column, IPredicateExpression predicateExpression, PredicateExpressionOperator operatorToUse) : this(column.Table.Name, column.Name, predicateExpression, operatorToUse) { }