/// <summary> /// Overrides the equality comparision. /// </summary> /// <param name="obj">Other object to compare with.</param> /// <returns>True, if the other <see langword="object"/> is equal to this. False, if not.</returns> public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } if (!base.Equals(obj)) { return(false); } AnonymousMetaType other = (AnonymousMetaType)obj; if (MetaProperties.Count != other.MetaProperties.Count) { return(false); } for (int i = 0; i < MetaProperties.Count; i++) { if (!MetaProperties[i].Equals(other.MetaProperties[i])) { return(false); } } return(true); }
/// <summary> /// Overrides the equality comparision. /// </summary> /// <param name="obj">Other object to compare with.</param> /// <returns>True, if the other <see langword="object"/> is equal to this. False, if not.</returns> public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } if (!base.Equals(obj)) { return(false); } AnonymousMetaType other = (AnonymousMetaType)obj; if (MetaProperties.Count != other.MetaProperties.Count) { return(false); } return(!MetaProperties.Where((t, i) => !t.Equals(other.MetaProperties[i])).Any()); }