Exemplo 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 (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (ShipId != null)
         {
             hashCode = hashCode * 59 + ShipId.GetHashCode();
         }
         if (ShipName != null)
         {
             hashCode = hashCode * 59 + ShipName.GetHashCode();
         }
         if (BookingDate != null)
         {
             hashCode = hashCode * 59 + BookingDate.GetHashCode();
         }
         if (Price != null)
         {
             hashCode = hashCode * 59 + Price.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (LicensePlate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ContainerId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ShipId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TrainId?.GetHashCode() ?? 0);
            return(hashCode);
        }