/// <summary> /// Returns true if EntityViewModel instances are equal /// </summary> /// <param name="other">Instance of EntityViewModel to be compared</param> /// <returns>Boolean</returns> public bool Equals(EntityViewModel other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( StringField == other.StringField || StringField != null && StringField.Equals(other.StringField) ) && ( RelationIdField == other.RelationIdField || RelationIdField != null && RelationIdField.Equals(other.RelationIdField) ) && ( DictionaryField == other.DictionaryField || DictionaryField != null && DictionaryField.Equals(other.DictionaryField) ) && ( IntegerField == other.IntegerField || IntegerField != null && IntegerField.Equals(other.IntegerField) ) && ( DoubleField == other.DoubleField || DoubleField != null && DoubleField.Equals(other.DoubleField) ) && ( DateField == other.DateField || DateField != null && DateField.Equals(other.DateField) ) && ( ExampleType == other.ExampleType || ExampleType != null && ExampleType.Equals(other.ExampleType) ) && ( ExampleStatus == other.ExampleStatus || ExampleStatus != null && ExampleStatus.Equals(other.ExampleStatus) )); }
/// <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); } }