public bool EqualsTo(ForeignKeyColumn foreignKeyColumn, ForeignKeyColumn auxiliaryForeignKeyColumn) { bool isAux = auxiliaryForeignKeyColumn != null; Table ownerTable = isAux ? foreignKeyColumn.Owner.ForeignTable : (Table)foreignKeyColumn.Owner.Owner; string ownerColumn = isAux ? foreignKeyColumn.ReferencedColumn : foreignKeyColumn.Name; Table foreignTable = isAux ? auxiliaryForeignKeyColumn.Owner.ForeignTable : foreignKeyColumn.Owner.ForeignTable; string targetColumn = isAux ? auxiliaryForeignKeyColumn.ReferencedColumn : foreignKeyColumn.ReferencedColumn; bool equals = Util.StringEqual(this.OwnerSetting.Table.Urn, ownerTable.Urn, true); equals &= Util.StringEqual(this.OwnerSetting.Column, ownerColumn, true); equals &= Util.StringEqual(this.TargetSetting.Table.Urn, foreignTable.Urn, true); equals &= Util.StringEqual(this.TargetSetting.Column, targetColumn, true); return(equals); }
protected internal override DBObject InternalResolveChildObject(DBObjectUrn childObjectUrn) { DBObject result = base.InternalResolveChildObject(childObjectUrn); if (result != null) { result = this; string foreignKeyColumnName = childObjectUrn[DbItemType.ForeignKeyColumn]; if (!string.IsNullOrEmpty(foreignKeyColumnName)) { ForeignKeyColumn foreignKeyColumnObj = this.ForeignKeyColumns.SingleOrDefault(item => Util.StringEqual(item.Name, foreignKeyColumnName, true)); if (foreignKeyColumnObj != null) { result = foreignKeyColumnObj.InternalResolveChildObject(childObjectUrn); } } return(result); } return(result); }
public bool EqualsTo(ForeignKeyColumn foreignKeyColumn) { return(EqualsTo(foreignKeyColumn, null)); }
public AssociationItem(ForeignKeyColumn foreignKeyColumn, AssocationType assocationType) : this(foreignKeyColumn, null, assocationType) { }