internal override bool IsProjectedSlot(int slot)
        {
            CellQuery rightCellQuery = this.LeftCellWrapper.RightCellQuery;

            if (this.IsBoolSlot(slot))
            {
                return(rightCellQuery.GetBoolVar(this.SlotToBoolIndex(slot)) != null);
            }
            return(rightCellQuery.ProjectedSlotAt(slot) != null);
        }
        internal override CqlBlock ToCqlBlock(
            bool[] requiredSlots,
            CqlIdentifiers identifiers,
            ref int blockAliasNum,
            ref List <WithRelationship> withRelationships)
        {
            int       length         = requiredSlots.Length;
            CellQuery rightCellQuery = this.LeftCellWrapper.RightCellQuery;

            SlotInfo[] slotInfoArray = new SlotInfo[length];
            for (int index = 0; index < rightCellQuery.NumProjectedSlots; ++index)
            {
                ProjectedSlot slotValue = rightCellQuery.ProjectedSlotAt(index);
                if (requiredSlots[index] && slotValue == null)
                {
                    ConstantProjectedSlot slot = new ConstantProjectedSlot(Domain.GetDefaultValueForMemberPath(this.ProjectedSlotMap[index], (IEnumerable <LeftCellWrapper>) this.GetLeaves(), this.ViewgenContext.Config));
                    rightCellQuery.FixMissingSlotAsDefaultConstant(index, slot);
                    slotValue = (ProjectedSlot)slot;
                }
                SlotInfo slotInfo = new SlotInfo(requiredSlots[index], slotValue != null, slotValue, this.ProjectedSlotMap[index]);
                slotInfoArray[index] = slotInfo;
            }
            for (int index = 0; index < rightCellQuery.NumBoolVars; ++index)
            {
                BoolExpression       boolVar = rightCellQuery.GetBoolVar(index);
                BooleanProjectedSlot booleanProjectedSlot = boolVar == null ? new BooleanProjectedSlot(BoolExpression.False, identifiers, index) : new BooleanProjectedSlot(boolVar, identifiers, index);
                int      slot     = this.BoolIndexToSlot(index);
                SlotInfo slotInfo = new SlotInfo(requiredSlots[slot], boolVar != null, (ProjectedSlot)booleanProjectedSlot, (MemberPath)null);
                slotInfoArray[slot] = slotInfo;
            }
            IEnumerable <SlotInfo> source = (IEnumerable <SlotInfo>)slotInfoArray;

            if (rightCellQuery.Extent.EntityContainer.DataSpace == DataSpace.SSpace && this.m_cellWrapper.LeftExtent.BuiltInTypeKind == BuiltInTypeKind.EntitySet)
            {
                IEnumerable <AssociationSetMapping> relationshipSetMappingsFor = this.ViewgenContext.EntityContainerMapping.GetRelationshipSetMappingsFor(this.m_cellWrapper.LeftExtent, rightCellQuery.Extent);
                List <SlotInfo> foreignKeySlots = new List <SlotInfo>();
                foreach (AssociationSetMapping colocatedAssociationSetMap in relationshipSetMappingsFor)
                {
                    WithRelationship withRelationship;
                    if (LeafCellTreeNode.TryGetWithRelationship(colocatedAssociationSetMap, this.m_cellWrapper.LeftExtent, rightCellQuery.SourceExtentMemberPath, ref foreignKeySlots, out withRelationship))
                    {
                        withRelationships.Add(withRelationship);
                        source = ((IEnumerable <SlotInfo>)slotInfoArray).Concat <SlotInfo>((IEnumerable <SlotInfo>)foreignKeySlots);
                    }
                }
            }
            return((CqlBlock) new ExtentCqlBlock(rightCellQuery.Extent, rightCellQuery.SelectDistinctFlag, source.ToArray <SlotInfo>(), rightCellQuery.WhereClause, identifiers, ++blockAliasNum));
        }