Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = ByteField.GetHashCode();
         hashCode = (hashCode * 397) ^ SByteField.GetHashCode();
         hashCode = (hashCode * 397) ^ Int16Field.GetHashCode();
         hashCode = (hashCode * 397) ^ UInt16Field.GetHashCode();
         hashCode = (hashCode * 397) ^ Int32Field;
         hashCode = (hashCode * 397) ^ (int)UInt32Field;
         hashCode = (hashCode * 397) ^ Int64Field.GetHashCode();
         hashCode = (hashCode * 397) ^ UInt64Field.GetHashCode();
         hashCode = (hashCode * 397) ^ DecimalField.GetHashCode();
         hashCode = (hashCode * 397) ^ SingleFiled.GetHashCode();
         hashCode = (hashCode * 397) ^ DoubleField.GetHashCode();
         hashCode = (hashCode * 397) ^ (StringField != null ? StringField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)MyEnumField;
         hashCode = (hashCode * 397) ^ BooleanField.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeField.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeOffsetField.GetHashCode();
         hashCode = (hashCode * 397) ^ GuidField.GetHashCode();
         hashCode = (hashCode * 397) ^ TimeSpanField.GetHashCode();
         hashCode = (hashCode * 397) ^ (UrlField != null ? UrlField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (NullField != null ? NullField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntArrayField != null ? IntArrayField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringArrayField != null ? StringArrayField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EmptyArrayField != null ? EmptyArrayField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (NullArrayField != null ? NullArrayField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DictionaryArrayField != null ? DictionaryArrayField.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ObjectArrayField != null ? ObjectArrayField.GetHashCode() : 0);
         return(hashCode);
     }
 }
 /// <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 :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (StringField != null)
         {
             hashCode = hashCode * 59 + StringField.GetHashCode();
         }
         if (RelationIdField != null)
         {
             hashCode = hashCode * 59 + RelationIdField.GetHashCode();
         }
         if (DictionaryField != null)
         {
             hashCode = hashCode * 59 + DictionaryField.GetHashCode();
         }
         if (IntegerField != null)
         {
             hashCode = hashCode * 59 + IntegerField.GetHashCode();
         }
         if (DoubleField != null)
         {
             hashCode = hashCode * 59 + DoubleField.GetHashCode();
         }
         if (DateField != null)
         {
             hashCode = hashCode * 59 + DateField.GetHashCode();
         }
         if (ExampleType != null)
         {
             hashCode = hashCode * 59 + ExampleType.GetHashCode();
         }
         if (ExampleStatus != null)
         {
             hashCode = hashCode * 59 + ExampleStatus.GetHashCode();
         }
         return(hashCode);
     }
 }