src/Misc/EFTools/EntityDesignModel/UpdateFromDatabase/AssociationEndIdentity.cs
/// <summary>
///     See whether the AssociationEndIdentity otherEndId contains a "covering" for this
///     i.e. for each AssociationPropertyIdentity in this._propertyIdentities see whether
///     otherEndId._propertyIdentities contains a principal->dependent mapping which has
///     at least the same principal DatabaseColumns (but possibly more) _and_ at least
///     the same dependent DatabaseColumns (but possibly more).
///     This allows for treating these AssociationEndIdentity's as identical for the purposes
///     of Update Model even if a given C-side property has been mapped to more than 1 S-side property.
/// </summary>
See whether the AssociationEndIdentity otherEndId contains a "covering" for this
i.e. for each AssociationPropertyIdentity in this._propertyIdentities see whether
otherEndId._propertyIdentities contains a principal->dependent mapping which has
at least the same principal DatabaseColumns (but possibly more) _and_ at least
the same dependent DatabaseColumns (but possibly more).
This allows for treating these AssociationEndIdentity's as identical for the purposes
of Update Model even if a given C-side property has been mapped to more than 1 S-side property.
See whether the AssociationEndIdentity otherEndId contains a " covering " for this i . e . for each AssociationPropertyIdentity in this . _propertyIdentities see whether otherEndId . _propertyIdentities contains a principal - > dependent mapping which has at least the same principal DatabaseColumns ( but possibly more ) _and_ at least the same dependent DatabaseColumns ( but possibly more ) . This allows for treating these AssociationEndIdentity ' s as identical for the purposes of Update Model even if a given C - side property has been mapped to more than 1 S - side property .
internal bool IsCoveredBy(AssociationEndIdentity otherEndId)
        {
            foreach (var thisApi in _propertyIdentities)
            {
                var foundCoveringApi = false;
                if (null != otherEndId)
                {
                    foreach (var otherApi in otherEndId._propertyIdentities)
                    {
                        if (thisApi.IsCoveredBy(otherApi))
                        {
                            foundCoveringApi = true;
                            break;
                        }
                    }
                }
                if (false == foundCoveringApi)
                {
                    return false;
                }
            }
            return true;
        }
internal bool IsCoveredBy ( AssociationEndIdentity otherEndId ) { foreach ( var thisApi in _propertyIdentities ) { var foundCoveringApi = false ; if ( null != otherEndId ) { foreach ( var otherApi in otherEndId . _propertyIdentities ) { if ( thisApi . IsCoveredBy ( otherApi ) ) { foundCoveringApi = true ; break ; } } } if ( false == foundCoveringApi ) { return false ; } } return true ; }
See whether the AssociationEndIdentity otherEndId contains a "covering" for this
i.e.
See whether the AssociationEndIdentity otherEndId contains a " covering " for this i . e .
// have found an AssociationPropertyIdentity in otherEndId._propertyIdentities which covers thisApi // no covering AssociationPropertyIdentity was found for thisApi in  // otherEndId._propertyIdentities // all AssociationPropertyIdentity's in this._propertyIdentities were covered by // AssociationPropertyIdentity's in other._propertyIdentities
otherEndId
AssociationEndIdentity