예제 #1
0
 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);
 }
예제 #2
0
 internal ColumnConstraint(IColumn column, IPredicateExpression predicateExpression, PredicateExpressionOperator operatorToUse)
     : this(column.Table.Name, column.Name, predicateExpression, operatorToUse)
 {
 }