コード例 #1
0
        public virtual void FindQuerySourcesRequiringMaterialization(
            [NotNull] EntityQueryModelVisitor queryModelVisitor, [NotNull] QueryModel queryModel)
        {
            Check.NotNull(queryModelVisitor, nameof(queryModelVisitor));
            Check.NotNull(queryModel, nameof(queryModel));

            var requiresEntityMaterializationExpressionVisitor
                = new RequiresMaterializationExpressionVisitor(queryModelVisitor);

            _querySourcesRequiringMaterialization
                = requiresEntityMaterializationExpressionVisitor
                  .FindQuerySourcesRequiringMaterialization(queryModel);

            foreach (var groupJoinClause in queryModel.BodyClauses.OfType <GroupJoinClause>())
            {
                _querySourcesRequiringMaterialization.Add(groupJoinClause.JoinClause);
            }
        }
コード例 #2
0
            public override void VisitGroupJoinClause(GroupJoinClause groupJoinClause, QueryModel queryModel, int index)
            {
                _querySourcesRequiringMaterialization.Add(queryModel.MainFromClause);
                _querySourcesRequiringMaterialization.Add(groupJoinClause.JoinClause);

                var subQueryInnerSequence = groupJoinClause.JoinClause.InnerSequence as SubQueryExpression;

                if (subQueryInnerSequence != null)
                {
                    var subQuerySourcesRequiringMaterialization =
                        _requiresMaterializationExpressionVisitor
                        .FindQuerySourcesRequiringMaterialization(subQueryInnerSequence.QueryModel);

                    foreach (var subQuerySource in subQuerySourcesRequiringMaterialization)
                    {
                        _querySourcesRequiringMaterialization.Add(subQuerySource);
                    }
                }
            }