EAAddinFramework.Databases.Table.getCorrespondingForeignKey C# (CSharp) Method

getCorrespondingForeignKey() public method

public getCorrespondingForeignKey ( ForeignKey newForeignKey ) : ForeignKey
newForeignKey ForeignKey
return ForeignKey
        public ForeignKey getCorrespondingForeignKey(ForeignKey newForeignKey)
        {
            var correspondingForeignKey = this.constraints.OfType<ForeignKey>()
                            .FirstOrDefault( x => x.name + x.properties == newForeignKey.name + newForeignKey.properties);
            if (correspondingForeignKey == null) correspondingForeignKey = this.constraints.OfType<ForeignKey>()
                .FirstOrDefault( x => x.logicalAssociation != null && x.logicalAssociation.Equals(newForeignKey.logicalAssociation));
            return correspondingForeignKey;
        }