Exemple #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((amount.GetHashCode() * 397) ^ (unit != null ? unit.GetHashCode() : 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 (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UnitOfMeasure != null)
         {
             hashCode = hashCode * 59 + UnitOfMeasure.GetHashCode();
         }
         if (MinimumValue != null)
         {
             hashCode = hashCode * 59 + MinimumValue.GetHashCode();
         }
         if (MaximumValue != null)
         {
             hashCode = hashCode * 59 + MaximumValue.GetHashCode();
         }
         if (RateApplicationMethod != null)
         {
             hashCode = hashCode * 59 + RateApplicationMethod.GetHashCode();
         }
         if (ApplicabilityConditions != null)
         {
             hashCode = hashCode * 59 + ApplicabilityConditions.GetHashCode();
         }
         return(hashCode);
     }
 }
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Currency?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (UnitOfMeasure?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Date?.GetHashCode() ?? 0);
            return(hashCode);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = PurchaseOrderId;
         hashCode = (hashCode * 397) ^ RawMaterialId;
         hashCode = (hashCode * 397) ^ SupplierId;
         hashCode = (hashCode * 397) ^ UnitPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ Quantity.GetHashCode();
         hashCode = (hashCode * 397) ^ (UnitOfMeasure != null ? UnitOfMeasure.GetHashCode() : 0);
         return(hashCode);
     }
 }