public override int GetHashCode() { unchecked { var hashCode = AlertID; hashCode = (hashCode * 397) ^ Code; hashCode = (hashCode * 397) ^ (Source != null ? Source.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Severity != null ? Severity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Created.GetHashCode(); hashCode = (hashCode * 397) ^ SnoozedEndDate.GetHashCode(); hashCode = (hashCode * 397) ^ (ThresholdValue1 != null ? ThresholdValue1.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ThresholdValue2 != null ? ThresholdValue2.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ThresholdValue3 != null ? ThresholdValue3.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ThresholdValue4 != null ? ThresholdValue4.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ThresholdValue5 != null ? ThresholdValue5.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DeviceGuid != null ? DeviceGuid.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AdditionalInfo != null ? AdditionalInfo.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AlertCategoryID != null ? AlertCategoryID.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Archived.GetHashCode(); hashCode = (hashCode * 397) ^ ArchivedDate.GetHashCode(); hashCode = (hashCode * 397) ^ TicketID.GetHashCode(); hashCode = (hashCode * 397) ^ (AlertMessage != null ? AlertMessage.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DeviceName != null ? DeviceName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ CustomerID; hashCode = (hashCode * 397) ^ (CustomerName != null ? CustomerName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (MessageTemplate != null ? MessageTemplate.GetHashCode() : 0); hashCode = (hashCode * 397) ^ FolderID.GetHashCode(); hashCode = (hashCode * 397) ^ PollingCyclesCount.GetHashCode(); 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 (TicketID != null) hashCode = hashCode * 59 + TicketID.GetHashCode(); if (TicketEventDateID != null) hashCode = hashCode * 59 + TicketEventDateID.GetHashCode(); return hashCode; } }