public static WhereStatement Copy(WhereStatement statement) { WhereStatement result = new WhereStatement(); int currentLevel = 0; foreach (List <WhereClause> level in statement) { currentLevel++; result.Add(new List <WhereClause>()); foreach (WhereClause clause in statement[currentLevel - 1]) { WhereClause clauseCopy = new WhereClause(clause.FieldName, clause.ComparisonOperator, clause.Value); foreach (WhereClause.SubClause subClause in clause.SubClauses) { WhereClause.SubClause subClauseCopy = new WhereClause.SubClause(subClause.LogicOperator, subClause.ComparisonOperator, subClause.Value); clauseCopy.SubClauses.Add(subClauseCopy); } result[currentLevel - 1].Add(clauseCopy); } } return(result); }
public void AddHaving(WhereClause clause, int level) { _havingStatement.Add(clause, level); }
public void AddWhere(WhereClause clause, int level) { _whereStatement.Add(clause, level); }