Beispiel #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Priority != null)
         {
             hashCode = hashCode * 59 + Priority.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Address != null)
         {
             hashCode = hashCode * 59 + Address.GetHashCode();
         }
         if (Duration != null)
         {
             hashCode = hashCode * 59 + Duration.GetHashCode();
         }
         if (PreparationTime != null)
         {
             hashCode = hashCode * 59 + PreparationTime.GetHashCode();
         }
         if (TimeWindows != null)
         {
             hashCode = hashCode * 59 + TimeWindows.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (RequiredSkills != null)
         {
             hashCode = hashCode * 59 + RequiredSkills.GetHashCode();
         }
         if (AllowedVehicles != null)
         {
             hashCode = hashCode * 59 + AllowedVehicles.GetHashCode();
         }
         if (DisallowedVehicles != null)
         {
             hashCode = hashCode * 59 + DisallowedVehicles.GetHashCode();
         }
         if (MaxTimeInVehicle != null)
         {
             hashCode = hashCode * 59 + MaxTimeInVehicle.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Returns true if Shipment instances are equal
        /// </summary>
        /// <param name="input">Instance of Shipment to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Shipment input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Id == input.Id ||
                     (Id != null &&
                      Id.Equals(input.Id))
                     ) &&
                 (
                     Name == input.Name ||
                     (Name != null &&
                      Name.Equals(input.Name))
                 ) &&
                 (
                     Priority == input.Priority ||
                     (Priority != null &&
                      Priority.Equals(input.Priority))
                 ) &&
                 (
                     Pickup == input.Pickup ||
                     (Pickup != null &&
                      Pickup.Equals(input.Pickup))
                 ) &&
                 (
                     Delivery == input.Delivery ||
                     (Delivery != null &&
                      Delivery.Equals(input.Delivery))
                 ) &&
                 (
                     Size == input.Size ||
                     Size != null &&
                     Size.SequenceEqual(input.Size)
                 ) &&
                 (
                     RequiredSkills == input.RequiredSkills ||
                     RequiredSkills != null &&
                     RequiredSkills.SequenceEqual(input.RequiredSkills)
                 ) &&
                 (
                     AllowedVehicles == input.AllowedVehicles ||
                     AllowedVehicles != null &&
                     AllowedVehicles.SequenceEqual(input.AllowedVehicles)
                 ) &&
                 (
                     DisallowedVehicles == input.DisallowedVehicles ||
                     DisallowedVehicles != null &&
                     DisallowedVehicles.SequenceEqual(input.DisallowedVehicles)
                 ) &&
                 (
                     MaxTimeInVehicle == input.MaxTimeInVehicle ||
                     (MaxTimeInVehicle != null &&
                      MaxTimeInVehicle.Equals(input.MaxTimeInVehicle))
                 ));
        }
Beispiel #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Priority != null)
         {
             hashCode = hashCode * 59 + Priority.GetHashCode();
         }
         if (Pickup != null)
         {
             hashCode = hashCode * 59 + Pickup.GetHashCode();
         }
         if (Delivery != null)
         {
             hashCode = hashCode * 59 + Delivery.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (RequiredSkills != null)
         {
             hashCode = hashCode * 59 + RequiredSkills.GetHashCode();
         }
         if (AllowedVehicles != null)
         {
             hashCode = hashCode * 59 + AllowedVehicles.GetHashCode();
         }
         if (DisallowedVehicles != null)
         {
             hashCode = hashCode * 59 + DisallowedVehicles.GetHashCode();
         }
         if (MaxTimeInVehicle != null)
         {
             hashCode = hashCode * 59 + MaxTimeInVehicle.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #4
0
        /// <summary>
        /// Returns true if Service instances are equal
        /// </summary>
        /// <param name="input">Instance of Service to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Service input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Id == input.Id ||
                     (Id != null &&
                      Id.Equals(input.Id))
                     ) &&
                 (
                     Type == input.Type ||
                     (Type != null &&
                      Type.Equals(input.Type))
                 ) &&
                 (
                     Priority == input.Priority ||
                     (Priority != null &&
                      Priority.Equals(input.Priority))
                 ) &&
                 (
                     Name == input.Name ||
                     (Name != null &&
                      Name.Equals(input.Name))
                 ) &&
                 (
                     Address == input.Address ||
                     (Address != null &&
                      Address.Equals(input.Address))
                 ) &&
                 (
                     Duration == input.Duration ||
                     (Duration != null &&
                      Duration.Equals(input.Duration))
                 ) &&
                 (
                     PreparationTime == input.PreparationTime ||
                     (PreparationTime != null &&
                      PreparationTime.Equals(input.PreparationTime))
                 ) &&
                 (
                     TimeWindows == input.TimeWindows ||
                     TimeWindows != null &&
                     TimeWindows.SequenceEqual(input.TimeWindows)
                 ) &&
                 (
                     Size == input.Size ||
                     Size != null &&
                     Size.SequenceEqual(input.Size)
                 ) &&
                 (
                     RequiredSkills == input.RequiredSkills ||
                     RequiredSkills != null &&
                     RequiredSkills.SequenceEqual(input.RequiredSkills)
                 ) &&
                 (
                     AllowedVehicles == input.AllowedVehicles ||
                     AllowedVehicles != null &&
                     AllowedVehicles.SequenceEqual(input.AllowedVehicles)
                 ) &&
                 (
                     DisallowedVehicles == input.DisallowedVehicles ||
                     DisallowedVehicles != null &&
                     DisallowedVehicles.SequenceEqual(input.DisallowedVehicles)
                 ) &&
                 (
                     MaxTimeInVehicle == input.MaxTimeInVehicle ||
                     (MaxTimeInVehicle != null &&
                      MaxTimeInVehicle.Equals(input.MaxTimeInVehicle))
                 ));
        }