//2. public override bool Equals(object obj) { if (MetadataKind != ModelMetadataKind.Property || !ContainerType.GetInterfaces().Contains(typeof(ICustomTypeDescriptor))) { return(base.Equals(obj)); } else { return(false); } }
//1. public override int GetHashCode() { if (MetadataKind != ModelMetadataKind.Property || !ContainerType.GetInterfaces().Contains(typeof(ICustomTypeDescriptor))) { return(base.GetHashCode()); } else { unchecked { int hash = 17; hash = hash * 31 + base.GetHashCode(); hash = hash * 31 + new Random().Next(); return(hash); }; } }