private void WriteJoinPredicates(DbTextWriter writer, IEnumerable <JoinPredicate> predicates) { foreach (JoinPredicate predicate in predicates) { writer.Write(" LEFT JOIN {0} ON ", "[" + predicate.ToColumn.Table.Owner + "].[" + predicate.ToColumn.Table.Name + "] " + writer.GetTableAlias(predicate.ToColumn.Table)); if (predicate.IsGroup) { WriteBeginGroup(writer); for (JoinPredicate current = predicate; current != null; current = current.NextInGroup) { WriteJoinPredicate(writer, current); } } else { WriteJoinPredicate(writer, predicate); } } }
protected virtual void OnWriteAnd(DbTextWriter writer) { writer.Write(" AND "); }
protected virtual void OnWriteEndGroup(DbTextWriter writer) { writer.Write(")"); groupCount--; }
protected virtual void OnWriteOr(DbTextWriter writer) { writer.Write(" OR "); }
protected virtual void OnWriteBeginGroup(DbTextWriter writer) { writer.Write("("); }