src/Misc/EFTools/EntityDesignModel/UpdateFromDatabase/AssociationIdentity.cs
/// <summary>
///     see whether this AssociationIdentity is "covered" by the one in id2 where "covered" means
///     is equivalent to (but allowing for one side potentially being an AssociationIdentityForAssociationSetMapping
///     whereas the other is an AssociationIdentityForReferentialConstraint and allowing for mapping of
///     multiple S-side properties to a single C-side property)
/// </summary>
see whether this AssociationIdentity is "covered" by the one in id2 where "covered" means
is equivalent to (but allowing for one side potentially being an AssociationIdentityForAssociationSetMapping
whereas the other is an AssociationIdentityForReferentialConstraint and allowing for mapping of
multiple S-side properties to a single C-side property)
see whether this AssociationIdentity is " covered " by the one in id2 where " covered " means is equivalent to ( but allowing for one side potentially being an AssociationIdentityForAssociationSetMapping whereas the other is an AssociationIdentityForReferentialConstraint and allowing for mapping of multiple S - side properties to a single C - side property )
[SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
        internal bool IsCoveredBy(AssociationIdentity id2)
        {
            var id1 = this;
            if (id1 is AssociationIdentityForAssociationSetMapping
                && id2 is AssociationIdentityForAssociationSetMapping)
            {
                var id1AsAIFASM = id1 as AssociationIdentityForAssociationSetMapping;
                var id2AsAIFASM = id2 as AssociationIdentityForAssociationSetMapping;
                return id1AsAIFASM.IsCoveredBy(id2AsAIFASM);
            }
            else if (id1 is AssociationIdentityForReferentialConstraint
                     && id2 is AssociationIdentityForReferentialConstraint)
            {
                var id1AsAIFRC = id1 as AssociationIdentityForReferentialConstraint;
                var id2AsAIFRC = id2 as AssociationIdentityForReferentialConstraint;
                return id1AsAIFRC.IsCoveredBy(id2AsAIFRC);
            }
            else if (id1 is AssociationIdentityForAssociationSetMapping
                     && id2 is AssociationIdentityForReferentialConstraint)
            {
                var rcid = id2 as AssociationIdentityForReferentialConstraint;
                var asmid = id1 as AssociationIdentityForAssociationSetMapping;
                return IsCoveredBy(rcid, asmid);
            }
            else if (id1 is AssociationIdentityForReferentialConstraint
                     && id2 is AssociationIdentityForAssociationSetMapping)
            {
                var rcid = id1 as AssociationIdentityForReferentialConstraint;
                var asmid = id2 as AssociationIdentityForAssociationSetMapping;
                return IsCoveredBy(rcid, asmid);
            }
            else
            {
                Debug.Fail("unexpected type of AssociationIdentity found id1=" + id1.TraceString() + ", id2=" + id2.TraceString());
            }
            return false;
        }
[ SuppressMessage ( " " , " " ) ] internal bool IsCoveredBy ( AssociationIdentity id2 ) { var id1 = this ; if ( id1 is AssociationIdentityForAssociationSetMapping && id2 is AssociationIdentityForAssociationSetMapping ) { var id1AsAIFASM = id1 as AssociationIdentityForAssociationSetMapping ; var id2AsAIFASM = id2 as AssociationIdentityForAssociationSetMapping ; return id1AsAIFASM . IsCoveredBy ( id2AsAIFASM ) ; } else if ( id1 is AssociationIdentityForReferentialConstraint && id2 is AssociationIdentityForReferentialConstraint ) { var id1AsAIFRC = id1 as AssociationIdentityForReferentialConstraint ; var id2AsAIFRC = id2 as AssociationIdentityForReferentialConstraint ; return id1AsAIFRC . IsCoveredBy ( id2AsAIFRC ) ; } else if ( id1 is AssociationIdentityForAssociationSetMapping && id2 is AssociationIdentityForReferentialConstraint ) { var rcid = id2 as AssociationIdentityForReferentialConstraint ; var asmid = id1 as AssociationIdentityForAssociationSetMapping ; return IsCoveredBy ( rcid , asmid ) ; } else if ( id1 is AssociationIdentityForReferentialConstraint && id2 is AssociationIdentityForAssociationSetMapping ) { var rcid = id1 as AssociationIdentityForReferentialConstraint ; var asmid = id2 as AssociationIdentityForAssociationSetMapping ; return IsCoveredBy ( rcid , asmid ) ; } else { Debug . Fail ( " " + id1 . TraceString ( ) + " " + id2 . TraceString ( ) ) ; } return false ; }
see whether this AssociationIdentity is "covered" by the one in id2 where "covered" means
is equivalent to (but allowing for one side potentially being an AssociationIdentityForAssociationSetMapping
whereas the other is an AssociationIdentityForReferentialConstraint and allowing for mapping of
multiple S-side properties to a single C-side property)
see whether this AssociationIdentity is " covered " by the one in id2 where " covered " means is equivalent to ( but allowing for one side potentially being an AssociationIdentityForAssociationSetMapping whereas the other is an AssociationIdentityForReferentialConstraint and allowing for mapping of multiple S - side properties to a single C - side property )
id2
AssociationIdentity