コード例 #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 (PayeeId != null)
         {
             hashCode = hashCode * 59 + PayeeId.GetHashCode();
         }
         if (Nickname != null)
         {
             hashCode = hashCode * 59 + Nickname.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (CreationDate != null)
         {
             hashCode = hashCode * 59 + CreationDate.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if BankingPayee instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingPayee to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingPayee other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PayeeId == other.PayeeId ||
                     PayeeId != null &&
                     PayeeId.Equals(other.PayeeId)
                     ) &&
                 (
                     Nickname == other.Nickname ||
                     Nickname != null &&
                     Nickname.Equals(other.Nickname)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     CreationDate == other.CreationDate ||
                     CreationDate != null &&
                     CreationDate.Equals(other.CreationDate)
                 ));
        }
コード例 #3
0
 public override string ToString()
 {
     return($"H,{PaymentNumber.Trim()},{PaymentAmount.Trim()},{PayeeId.Trim()},{PaymentDate.Trim()},{FreeFormAddress1?.Trim().EscapeCSV()},{FreeFormAddress2?.Trim().EscapeCSV()},{FreeFormAddress3?.Trim().EscapeCSV()},{FreeFormAddress4?.Trim().EscapeCSV()},{FreeFormAddress5?.Trim().EscapeCSV()}");
 }