예제 #1
0
        /// <summary>
        ///     Find the Foreign Key Associations that relate EntitySets used in these left cell wrappers and
        ///     add any equivalence facts between sets implied by 1:1 associations.
        ///     We can collect other implication facts but we don't have a scenario that needs them( yet ).
        /// </summary>
        private void CreateConstraintsForForeignKeyAssociationsAffectingThisWrapper(
            FragmentQueryKB rightKB, MemberDomainMap rightDomainMap)
        {
            var oneToOneForeignKeyAssociationSetsForThisWrapper
                = new OneToOneFkAssociationsForEntitiesFilter()
                  .Filter(
                      m_cellWrappers.Select(it => it.RightExtent).OfType <EntitySet>().Select(it => it.ElementType).ToList(),
                      m_entityContainerMapping.EdmEntityContainer.BaseEntitySets.OfType <AssociationSet>());

            // Collect the facts for the foreign key association sets that are 1:1 and affecting this wrapper
            foreach (var assocSet in oneToOneForeignKeyAssociationSetsForThisWrapper)
            {
                rightKB.CreateEquivalenceConstraintForOneToOneForeignKeyAssociation(assocSet, rightDomainMap);
            }
        }
예제 #2
0
        // <summary>
        // Find the Foreign Key Associations that relate EntitySets used in these left cell wrappers and
        // add any equivalence facts between sets implied by 1:1 associations.
        // We can collect other implication facts but we don't have a scenario that needs them( yet ).
        // </summary>
        private void CreateConstraintsForForeignKeyAssociationsAffectingThisWrapper(
            FragmentQueryKB rightKB, MemberDomainMap rightDomainMap)
        {
            var oneToOneForeignKeyAssociationSetsForThisWrapper
                = new OneToOneFkAssociationsForEntitiesFilter()
                    .Filter(
                        m_cellWrappers.Select(it => it.RightExtent).OfType<EntitySet>().Select(it => it.ElementType).ToList(),
                        m_entityContainerMapping.EdmEntityContainer.BaseEntitySets.OfType<AssociationSet>());

            // Collect the facts for the foreign key association sets that are 1:1 and affecting this wrapper
            foreach (var assocSet in oneToOneForeignKeyAssociationSetsForThisWrapper)
            {
                rightKB.CreateEquivalenceConstraintForOneToOneForeignKeyAssociation(assocSet, rightDomainMap);
            }
        }