/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current object. /// </returns> public override int GetHashCode() { unchecked { var hashCode = Name != null?Name.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (int)Type; hashCode = (hashCode * 397) ^ (EntityName != null ? EntityName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DataType != null ? DataType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsAttribute.GetHashCode(); return(hashCode); } }
/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <returns> /// true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false. /// </returns> /// <param name="other">An object to compare with this object.</param> public bool Equals(TypeMemberInfo other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(string.Equals(Name, other.Name) && Type == other.Type && string.Equals(EntityName, other.EntityName) && Equals(DataType, other.DataType) && IsAttribute.Equals(other.IsAttribute)); }