protected override void ModifyFetchQueryModel(QueryModel fetchQueryModel) { ArgumentUtility.CheckNotNull<QueryModel>("fetchQueryModel", fetchQueryModel); System.Linq.Expressions.MemberExpression fromExpression = System.Linq.Expressions.Expression.MakeMemberAccess(new QuerySourceReferenceExpression(fetchQueryModel.MainFromClause), base.RelationMember); AdditionalFromClause additionalFromClause = new AdditionalFromClause(fetchQueryModel.GetNewName("#fetch"), this._relatedObjectType, fromExpression); fetchQueryModel.BodyClauses.Add(additionalFromClause); QuerySourceReferenceExpression selector = new QuerySourceReferenceExpression(additionalFromClause); SelectClause selectClause = new SelectClause(selector); fetchQueryModel.SelectClause = selectClause; }