public getCorrespondingForeignKey ( |
||
newForeignKey | ||
return |
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;
}