public void Delete(ref SQLSelectTableJoinCondition objOrderByField)
        {
            if (!pobjConditions.Contains(objOrderByField))
                throw new IndexOutOfRangeException();

            pobjConditions.Remove(objOrderByField);
            objOrderByField = null;
        }
        public SQLSelectTableJoinCondition Add(string strLeftTableFieldName, ComparisonOperator eCompare, string strRightTableFieldName)
        {
            if (pobjParent == null)
                throw new InvalidOperationException("Use overloaded Add(SQLExpression, ComparisonOperator, SQLExpression) instead");

            //The Add function is here basically for backward compatibility when the conditions could only accept field names and the left and right tables from the parent join were used as table aliases.
            //Now that that SQLSelectTableBase is being used (which can represent a table or joined tables) we need to check that parent left and right tables are only SQLSelectTable objects.
            if (!(pobjParent.LeftTable is SQLSelectTable))
                throw new ArgumentException("The left table is expected to be an SQLSelectTable so that the left table alias can be utilised for the strLeftTableFieldName argument. Use the Add(SQLExpression, ComparisonOperator, SQLExpression) overload instead.");
            else if (!(pobjParent.RightTable is SQLSelectTable))
                throw new ArgumentException("The right table is expected to be an SQLSelectTable so that the right table alias can be utilised for the strRightTableFieldName argument. Use the Add(SQLExpression, ComparisonOperator, SQLExpression) overload instead.");

            SQLSelectTableJoinCondition joinCondition;

            EnsureComparisonOperatorValid(eCompare);
            AddLogicalOperatorIfRequired();

            joinCondition = new SQLSelectTableJoinCondition();
            joinCondition.LeftExpression = new SQLFieldExpression((SQLSelectTable)pobjParent.LeftTable, strLeftTableFieldName);
            joinCondition.Compare = eCompare;
            joinCondition.RightExpression = new SQLFieldExpression((SQLSelectTable)pobjParent.RightTable, strRightTableFieldName);

            pobjConditions.Add(joinCondition);

            return joinCondition;
        }
        public SQLSelectTableJoinCondition Add(SQLExpression objLeftExpression, ComparisonOperator eCompare, SQLExpression objRightExpression)
        {
            EnsureComparisonOperatorValid(eCompare);
            AddLogicalOperatorIfRequired();

            var joinCondition = new SQLSelectTableJoinCondition();

            joinCondition.LeftExpression = objLeftExpression;
            joinCondition.Compare = eCompare;
            joinCondition.RightExpression = objRightExpression;

            pobjConditions.Add(joinCondition);

            return joinCondition;
        }