/// <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 (TicketEventDateID != null) { hashCode = hashCode * 59 + TicketEventDateID.GetHashCode(); } if (TicketEventID != null) { hashCode = hashCode * 59 + TicketEventID.GetHashCode(); } if (VenueID != null) { hashCode = hashCode * 59 + VenueID.GetHashCode(); } if (EventStartDateTime != null) { hashCode = hashCode * 59 + EventStartDateTime.GetHashCode(); } if (MaxTickets != null) { hashCode = hashCode * 59 + MaxTickets.GetHashCode(); } if (Price != null) { hashCode = hashCode * 59 + Price.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if EventDate instances are equal /// </summary> /// <param name="other">Instance of EventDate to be compared</param> /// <returns>Boolean</returns> public bool Equals(EventDate other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( TicketEventDateID == other.TicketEventDateID || TicketEventDateID != null && TicketEventDateID.Equals(other.TicketEventDateID) ) && ( TicketEventID == other.TicketEventID || TicketEventID != null && TicketEventID.Equals(other.TicketEventID) ) && ( VenueID == other.VenueID || VenueID != null && VenueID.Equals(other.VenueID) ) && ( EventStartDateTime == other.EventStartDateTime || EventStartDateTime != null && EventStartDateTime.Equals(other.EventStartDateTime) ) && ( MaxTickets == other.MaxTickets || MaxTickets != null && MaxTickets.Equals(other.MaxTickets) ) && ( Price == other.Price || Price != null && Price.Equals(other.Price) )); }