///<summary> /// Returns a value indicating whether this instance is equal to a specified object. ///</summary> ///<param name="toObject">An object to compare to this instance.</param> ///<returns>true if toObject is a <see cref="VAdditionalContactInfoBase"/> and has the same value as this instance; otherwise, false.</returns> public virtual bool Equals(VAdditionalContactInfoBase toObject) { if (toObject == null) { return(false); } return(Equals(this, toObject)); }
///<summary> /// Determines whether the specified <see cref="VAdditionalContactInfoBase"/> instances are considered equal. ///</summary> ///<param name="Object1">The first <see cref="VAdditionalContactInfoBase"/> to compare.</param> ///<param name="Object2">The second <see cref="VAdditionalContactInfoBase"/> to compare. </param> ///<returns>true if Object1 is the same instance as Object2 or if both are null references or if objA.Equals(objB) returns true; otherwise, false.</returns> public static bool Equals(VAdditionalContactInfoBase Object1, VAdditionalContactInfoBase Object2) { // both are null if (Object1 == null && Object2 == null) return true; // one or the other is null, but not both if (Object1 == null ^ Object2 == null) return false; bool equal = true; if (Object1.ContactId != Object2.ContactId) equal = false; if (Object1.FirstName != Object2.FirstName) equal = false; if (Object1.MiddleName != null && Object2.MiddleName != null ) { if (Object1.MiddleName != Object2.MiddleName) equal = false; } else if (Object1.MiddleName == null ^ Object1.MiddleName == null ) { equal = false; } if (Object1.LastName != Object2.LastName) equal = false; if (Object1.TelephoneNumber != null && Object2.TelephoneNumber != null ) { if (Object1.TelephoneNumber != Object2.TelephoneNumber) equal = false; } else if (Object1.TelephoneNumber == null ^ Object1.TelephoneNumber == null ) { equal = false; } if (Object1.TelephoneSpecialInstructions != null && Object2.TelephoneSpecialInstructions != null ) { if (Object1.TelephoneSpecialInstructions != Object2.TelephoneSpecialInstructions) equal = false; } else if (Object1.TelephoneSpecialInstructions == null ^ Object1.TelephoneSpecialInstructions == null ) { equal = false; } if (Object1.Street != null && Object2.Street != null ) { if (Object1.Street != Object2.Street) equal = false; } else if (Object1.Street == null ^ Object1.Street == null ) { equal = false; } if (Object1.City != null && Object2.City != null ) { if (Object1.City != Object2.City) equal = false; } else if (Object1.City == null ^ Object1.City == null ) { equal = false; } if (Object1.StateProvince != null && Object2.StateProvince != null ) { if (Object1.StateProvince != Object2.StateProvince) equal = false; } else if (Object1.StateProvince == null ^ Object1.StateProvince == null ) { equal = false; } if (Object1.PostalCode != null && Object2.PostalCode != null ) { if (Object1.PostalCode != Object2.PostalCode) equal = false; } else if (Object1.PostalCode == null ^ Object1.PostalCode == null ) { equal = false; } if (Object1.CountryRegion != null && Object2.CountryRegion != null ) { if (Object1.CountryRegion != Object2.CountryRegion) equal = false; } else if (Object1.CountryRegion == null ^ Object1.CountryRegion == null ) { equal = false; } if (Object1.HomeAddressSpecialInstructions != null && Object2.HomeAddressSpecialInstructions != null ) { if (Object1.HomeAddressSpecialInstructions != Object2.HomeAddressSpecialInstructions) equal = false; } else if (Object1.HomeAddressSpecialInstructions == null ^ Object1.HomeAddressSpecialInstructions == null ) { equal = false; } if (Object1.EmailAddress != null && Object2.EmailAddress != null ) { if (Object1.EmailAddress != Object2.EmailAddress) equal = false; } else if (Object1.EmailAddress == null ^ Object1.EmailAddress == null ) { equal = false; } if (Object1.EmailSpecialInstructions != null && Object2.EmailSpecialInstructions != null ) { if (Object1.EmailSpecialInstructions != Object2.EmailSpecialInstructions) equal = false; } else if (Object1.EmailSpecialInstructions == null ^ Object1.EmailSpecialInstructions == null ) { equal = false; } if (Object1.EmailTelephoneNumber != null && Object2.EmailTelephoneNumber != null ) { if (Object1.EmailTelephoneNumber != Object2.EmailTelephoneNumber) equal = false; } else if (Object1.EmailTelephoneNumber == null ^ Object1.EmailTelephoneNumber == null ) { equal = false; } if (Object1.Rowguid != Object2.Rowguid) equal = false; if (Object1.ModifiedDate != Object2.ModifiedDate) equal = false; return equal; }
///<summary> /// Returns a value indicating whether this instance is equal to a specified object. ///</summary> ///<param name="toObject">An object to compare to this instance.</param> ///<returns>true if toObject is a <see cref="VAdditionalContactInfoBase"/> and has the same value as this instance; otherwise, false.</returns> public virtual bool Equals(VAdditionalContactInfoBase toObject) { if (toObject == null) return false; return Equals(this, toObject); }
///<summary> /// Determines whether the specified <see cref="VAdditionalContactInfoBase"/> instances are considered equal. ///</summary> ///<param name="Object1">The first <see cref="VAdditionalContactInfoBase"/> to compare.</param> ///<param name="Object2">The second <see cref="VAdditionalContactInfoBase"/> to compare. </param> ///<returns>true if Object1 is the same instance as Object2 or if both are null references or if objA.Equals(objB) returns true; otherwise, false.</returns> public static bool Equals(VAdditionalContactInfoBase Object1, VAdditionalContactInfoBase Object2) { // both are null if (Object1 == null && Object2 == null) { return(true); } // one or the other is null, but not both if (Object1 == null ^ Object2 == null) { return(false); } bool equal = true; if (Object1.ContactId != Object2.ContactId) { equal = false; } if (Object1.FirstName != Object2.FirstName) { equal = false; } if (Object1.MiddleName != null && Object2.MiddleName != null) { if (Object1.MiddleName != Object2.MiddleName) { equal = false; } } else if (Object1.MiddleName == null ^ Object1.MiddleName == null) { equal = false; } if (Object1.LastName != Object2.LastName) { equal = false; } if (Object1.TelephoneNumber != null && Object2.TelephoneNumber != null) { if (Object1.TelephoneNumber != Object2.TelephoneNumber) { equal = false; } } else if (Object1.TelephoneNumber == null ^ Object1.TelephoneNumber == null) { equal = false; } if (Object1.TelephoneSpecialInstructions != null && Object2.TelephoneSpecialInstructions != null) { if (Object1.TelephoneSpecialInstructions != Object2.TelephoneSpecialInstructions) { equal = false; } } else if (Object1.TelephoneSpecialInstructions == null ^ Object1.TelephoneSpecialInstructions == null) { equal = false; } if (Object1.Street != null && Object2.Street != null) { if (Object1.Street != Object2.Street) { equal = false; } } else if (Object1.Street == null ^ Object1.Street == null) { equal = false; } if (Object1.City != null && Object2.City != null) { if (Object1.City != Object2.City) { equal = false; } } else if (Object1.City == null ^ Object1.City == null) { equal = false; } if (Object1.StateProvince != null && Object2.StateProvince != null) { if (Object1.StateProvince != Object2.StateProvince) { equal = false; } } else if (Object1.StateProvince == null ^ Object1.StateProvince == null) { equal = false; } if (Object1.PostalCode != null && Object2.PostalCode != null) { if (Object1.PostalCode != Object2.PostalCode) { equal = false; } } else if (Object1.PostalCode == null ^ Object1.PostalCode == null) { equal = false; } if (Object1.CountryRegion != null && Object2.CountryRegion != null) { if (Object1.CountryRegion != Object2.CountryRegion) { equal = false; } } else if (Object1.CountryRegion == null ^ Object1.CountryRegion == null) { equal = false; } if (Object1.HomeAddressSpecialInstructions != null && Object2.HomeAddressSpecialInstructions != null) { if (Object1.HomeAddressSpecialInstructions != Object2.HomeAddressSpecialInstructions) { equal = false; } } else if (Object1.HomeAddressSpecialInstructions == null ^ Object1.HomeAddressSpecialInstructions == null) { equal = false; } if (Object1.EmailAddress != null && Object2.EmailAddress != null) { if (Object1.EmailAddress != Object2.EmailAddress) { equal = false; } } else if (Object1.EmailAddress == null ^ Object1.EmailAddress == null) { equal = false; } if (Object1.EmailSpecialInstructions != null && Object2.EmailSpecialInstructions != null) { if (Object1.EmailSpecialInstructions != Object2.EmailSpecialInstructions) { equal = false; } } else if (Object1.EmailSpecialInstructions == null ^ Object1.EmailSpecialInstructions == null) { equal = false; } if (Object1.EmailTelephoneNumber != null && Object2.EmailTelephoneNumber != null) { if (Object1.EmailTelephoneNumber != Object2.EmailTelephoneNumber) { equal = false; } } else if (Object1.EmailTelephoneNumber == null ^ Object1.EmailTelephoneNumber == null) { equal = false; } if (Object1.Rowguid != Object2.Rowguid) { equal = false; } if (Object1.ModifiedDate != Object2.ModifiedDate) { equal = false; } return(equal); }