Beispiel #1
0
        /// <summary>
        /// Returns true if Insurance instances are equal
        /// </summary>
        /// <param name="other">Instance of Insurance to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Insurance other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DateOfExpiry == other.DateOfExpiry ||
                     DateOfExpiry != null &&
                     DateOfExpiry.Equals(other.DateOfExpiry)
                     ) &&
                 (
                     Coverage == other.Coverage ||
                     Coverage != null &&
                     Coverage.Equals(other.Coverage)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ));
        }
Beispiel #2
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ValueOfLoC?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (IssuingBank?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Detail?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (UploadOfScan?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Calculated?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DateOfValidity?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DateOfExpiry?.GetHashCode() ?? 0);
            return(hashCode);
        }
Beispiel #3
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 (DateOfExpiry != null)
         {
             hashCode = hashCode * 59 + DateOfExpiry.GetHashCode();
         }
         if (Coverage != null)
         {
             hashCode = hashCode * 59 + Coverage.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #4
0
 public string SetAttributeValuesUpdate()
 {
     return($"WageAmount = {ContractAmount}, DateOfTermination = '{DateOfExpiry.ToShortDateString()}'");
 }