public int GetHashCode(IdNameBase <TKey> obj) { unchecked { return((EqualityComparer <TKey> .Default.GetHashCode(obj.Id) * 397) ^ (obj.Name != null ? obj.Name.GetHashCode() : 0)); } }
public bool Equals(IdNameBase <TKey> x, IdNameBase <TKey> y) { if (ReferenceEquals(x, y)) { return(true); } if (ReferenceEquals(x, null)) { return(false); } if (ReferenceEquals(y, null)) { return(false); } if (x.GetType() != y.GetType()) { return(false); } return(EqualityComparer <TKey> .Default.Equals(x.Id, y.Id) && string.Equals(x.Name, y.Name)); }
public bool Equals(IdNameBase <TKey> other) { return(Equals(this, other)); }