public override bool Equals(object obj)
            {
                var other = obj as Address;

                if (other == null)
                {
                    return(false);
                }

                return(Suburb.Equals(other.Suburb) && Postcode.Equals(other.Postcode));
            }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            var otherAddress = obj as Address;

            if (otherAddress == null || Address1 == null)
            {
                return(false);
            }

            if (!Address1.Equals(otherAddress.Address1))
            {
                return(false);
            }
            if (Address2 != null)
            {
                if (!Address2.Equals(otherAddress.Address2))
                {
                    return(false);
                }
            }
            if (Suburb != null)
            {
                if (!Suburb.Equals(otherAddress.Suburb))
                {
                    return(false);
                }
            }
            if (Postcode != null)
            {
                if (!Postcode.Equals(otherAddress.Postcode))
                {
                    return(false);
                }
            }
            if (State != null)
            {
                if (!State.Equals(otherAddress.State))
                {
                    return(false);
                }
            }

            return(true);
        }