Exemplo n.º 1
0
        /// <summary>
        /// Returns true if WaitingListEntry instances are equal
        /// </summary>
        /// <param name="other">Instance of WaitingListEntry to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(WaitingListEntry other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     PatientId == other.PatientId ||
                     PatientId != null &&
                     PatientId.Equals(other.PatientId)
                 ) &&
                 (
                     Since == other.Since ||
                     Since != null &&
                     Since.Equals(other.Since)
                 ) &&
                 (
                     Estimated == other.Estimated ||
                     Estimated != null &&
                     Estimated.Equals(other.Estimated)
                 ) &&
                 (
                     EstimatedDurationMinutes == other.EstimatedDurationMinutes ||
                     EstimatedDurationMinutes != null &&
                     EstimatedDurationMinutes.Equals(other.EstimatedDurationMinutes)
                 ) &&
                 (
                     Condition == other.Condition ||
                     Condition != null &&
                     Condition.Equals(other.Condition)
                 ));
        }
Exemplo n.º 2
0
 /// <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 (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (PatientId != null)
         {
             hashCode = hashCode * 59 + PatientId.GetHashCode();
         }
         if (Since != null)
         {
             hashCode = hashCode * 59 + Since.GetHashCode();
         }
         if (Estimated != null)
         {
             hashCode = hashCode * 59 + Estimated.GetHashCode();
         }
         if (EstimatedDurationMinutes != null)
         {
             hashCode = hashCode * 59 + EstimatedDurationMinutes.GetHashCode();
         }
         if (Condition != null)
         {
             hashCode = hashCode * 59 + Condition.GetHashCode();
         }
         return(hashCode);
     }
 }