/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) hashCode = hashCode * 59 + IdPlace.GetHashCode(); if (ZipCode != null) { hashCode = hashCode * 59 + ZipCode.GetHashCode(); } if (_Place != null) { hashCode = hashCode * 59 + _Place.GetHashCode(); } if (Canton != null) { hashCode = hashCode * 59 + Canton.GetHashCode(); } if (CantonAbb != null) { hashCode = hashCode * 59 + CantonAbb.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { var hashCode = 875105097; hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + IdPlace.GetHashCode(); return(hashCode); }
/// <summary> /// Returns true if Place instances are equal /// </summary> /// <param name="other">Instance of Place to be compared</param> /// <returns>Boolean</returns> public bool Equals(Place other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( IdPlace == other.IdPlace || IdPlace.Equals(other.IdPlace) ) && ( ZipCode == other.ZipCode || ZipCode != null && ZipCode.Equals(other.ZipCode) ) && ( _Place == other._Place || _Place != null && _Place.Equals(other._Place) ) && ( Canton == other.Canton || Canton != null && Canton.Equals(other.Canton) ) && ( CantonAbb == other.CantonAbb || CantonAbb != null && CantonAbb.Equals(other.CantonAbb) )); }