/// <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 (Unit != null)
                {
                    hashCode = hashCode * 59 + Unit.GetHashCode();
                }
                if (Post != null)
                {
                    hashCode = hashCode * 59 + Post.GetHashCode();
                }
                if (PostingType != null)
                {
                    hashCode = hashCode * 59 + PostingType.GetHashCode();
                }
                if (AssignmentNumber != null)
                {
                    hashCode = hashCode * 59 + AssignmentNumber.GetHashCode();
                }
                if (Team != null)
                {
                    hashCode = hashCode * 59 + Team.GetHashCode();
                }

                hashCode = hashCode * 59 + IsPrimary.GetHashCode();
                return(hashCode);
            }
        }
Exemple #2
0
        /// <summary>
        /// Returns true if DutyAssignmentRedeploymentEvent instances are equal
        /// </summary>
        /// <param name="other">Instance of DutyAssignmentRedeploymentEvent to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DutyAssignmentRedeploymentEvent other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AssignmentNumber == other.AssignmentNumber ||
                     AssignmentNumber != null &&
                     AssignmentNumber.Equals(other.AssignmentNumber)
                     ) &&
                 (
                     OriginalDuty == other.OriginalDuty ||
                     OriginalDuty != null &&
                     OriginalDuty.Equals(other.OriginalDuty)
                 ) &&
                 (
                     NewDuty == other.NewDuty ||
                     NewDuty != null &&
                     NewDuty.Equals(other.NewDuty)
                 ));
        }
        /// <summary>
        /// Returns true if Posting instances are equal
        /// </summary>
        /// <param name="other">Instance of Posting to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Posting other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Unit == other.Unit ||
                     Unit != null &&
                     Unit.Equals(other.Unit)
                     ) &&
                 (
                     Post == other.Post ||
                     Post != null &&
                     Post.Equals(other.Post)
                 ) &&
                 (
                     PostingType == other.PostingType ||
                     PostingType != null &&
                     PostingType.Equals(other.PostingType)
                 ) &&
                 (
                     AssignmentNumber == other.AssignmentNumber ||
                     AssignmentNumber != null &&
                     AssignmentNumber.Equals(other.AssignmentNumber)
                 ) &&
                 (
                     Team == other.Team ||
                     Team != null &&
                     Team.Equals(other.Team)
                 ) &&
                 (
                     IsPrimary == other.IsPrimary ||

                     IsPrimary.Equals(other.IsPrimary)
                 ));
        }
Exemple #4
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 (AssignmentNumber != null)
         {
             hashCode = hashCode * 59 + AssignmentNumber.GetHashCode();
         }
         if (OriginalDuty != null)
         {
             hashCode = hashCode * 59 + OriginalDuty.GetHashCode();
         }
         if (NewDuty != null)
         {
             hashCode = hashCode * 59 + NewDuty.GetHashCode();
         }
         return(hashCode);
     }
 }