public virtual void RemoveAssociation(SimpleAssociatedEntity association) { if (AssociatedEntities.Contains(association)) { association.UnbindFromCurrentOwner(); } else { throw new ArgumentException("SimpleAssociatedEntity [" + association + "] not currently bound to this [" + this + "]"); } }
public virtual bool Equals(SimpleAssociatedEntity other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.Id, Id)); }
public virtual bool Equals(SimpleAssociatedEntity other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return Equals(other.Id, Id); }
public virtual void AddAssociation(SimpleAssociatedEntity association) { association.BindToOwner(this); }
public virtual SimpleAssociatedEntity AddAssociation(string aName) { var result = new SimpleAssociatedEntity {Name = aName, Owner = this}; AddAssociation(result); return result; }