Exemplo n.º 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)
                 ));
        }