public override void VisitMainFromClause(Remotion.Linq.Clauses.MainFromClause fromClause, QueryModel queryModel) { if (fromClause.FromExpression is SubQueryExpression) { var subquery = fromClause.FromExpression as SubQueryExpression; VisitQueryModel(subquery.QueryModel); } else { _queryBuilder.AddFromPart(fromClause); } base.VisitMainFromClause(fromClause, queryModel); }