Ejemplo n.º 1
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 (VisitId != null)
         {
             hashCode = hashCode * 59 + VisitId.GetHashCode();
         }
         if (Date != null)
         {
             hashCode = hashCode * 59 + Date.GetHashCode();
         }
         if (Price != null)
         {
             hashCode = hashCode * 59 + Price.GetHashCode();
         }
         if (RequiredActions != null)
         {
             hashCode = hashCode * 59 + RequiredActions.GetHashCode();
         }
         if (Status != null)
         {
             hashCode = hashCode * 59 + Status.GetHashCode();
         }
         if (AssignedEmployees != null)
         {
             hashCode = hashCode * 59 + AssignedEmployees.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo 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 (Date != null)
         {
             hashCode = hashCode * 59 + Date.GetHashCode();
         }
         if (RequiredActions != null)
         {
             hashCode = hashCode * 59 + RequiredActions.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if Visit instances are equal
        /// </summary>
        /// <param name="other">Instance of Visit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Visit other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     VisitId == other.VisitId ||
                     VisitId != null &&
                     VisitId.Equals(other.VisitId)
                     ) &&
                 (
                     Date == other.Date ||
                     Date != null &&
                     Date.Equals(other.Date)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ) &&
                 (
                     RequiredActions == other.RequiredActions ||
                     RequiredActions != null &&
                     RequiredActions.SequenceEqual(other.RequiredActions)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     AssignedEmployees == other.AssignedEmployees ||
                     AssignedEmployees != null &&
                     AssignedEmployees.SequenceEqual(other.AssignedEmployees)
                 ));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns true if Body3 instances are equal
        /// </summary>
        /// <param name="other">Instance of Body3 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Body3 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Date == other.Date ||
                     Date != null &&
                     Date.Equals(other.Date)
                     ) &&
                 (
                     RequiredActions == other.RequiredActions ||
                     RequiredActions != null &&
                     RequiredActions.SequenceEqual(other.RequiredActions)
                 ));
        }
Ejemplo n.º 5
0
 public RequiredArgumentsException(IEnumerable <ActionAP> requiredActions)
 {
     RequiredActions   = (requiredActions ?? new ActionAP[] { }).ToList();
     RequiredArguments = RequiredActions.Select(GetArgumentName).ToList();
     message           = string.Format("The following arguments are required: {0}", string.Join(", ", RequiredArguments));
 }