Exemplo n.º 1
0
        // /// <summary>
        // /// Returns the string presentation of the object
        // /// </summary>
        // /// <returns>String presentation of the object</returns>
        // public override string ToString()
        // {
        //  var sb = new StringBuilder();

        //  sb.Append("class User {\n");
        //  sb.Append("  Id: ").Append(ContactId).Append("\n");
        //  sb.Append("  GivenName: ").Append(GivenName).Append("\n");
        //  sb.Append("  Surname: ").Append(Surname).Append("\n");
        //  sb.Append("  Active: ").Append(Active).Append("\n");
        //  sb.Append("  Initials: ").Append(Initials).Append("\n");
        //  sb.Append("  Email: ").Append(Email).Append("\n");
        //  sb.Append("  SmUserId: ").Append(SmUserId).Append("\n");
        //  sb.Append("  Guid: ").Append(AccountId).Append("\n");
        //  sb.Append("  SmAuthorizationDirectory: ").Append(UserType).Append("\n");
        //  sb.Append("  UserRoles: ").Append(UserRoles).Append("\n");
        //  sb.Append("}\n");

        //  return sb.ToString();
        // }

        // /// <summary>
        // /// Returns the JSON string presentation of the object
        // /// </summary>
        // /// <returns>JSON string presentation of the object</returns>
        // public string ToJson()
        // {
        //  return JsonConvert.SerializeObject(this, Formatting.Indented);
        // }

        // /// <summary>
        // /// Returns true if objects are equal
        // /// </summary>
        // /// <param name="obj">Object to be compared</param>
        // /// <returns>Boolean</returns>
        // public override bool Equals(object obj)
        // {
        //  if (obj is null) { return false; }
        //  if (ReferenceEquals(this, obj)) { return true; }
        //  return obj.GetType() == GetType() && Equals((User)obj);
        // }

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

            return((
                       ContactId == other.ContactId ||
                       ContactId.Equals(other.ContactId)
                       ) &&
                   (
                       GivenName == other.GivenName ||
                       GivenName != null &&
                       GivenName.Equals(other.GivenName)
                   ) &&
                   (
                       Surname == other.Surname ||
                       Surname != null &&
                       Surname.Equals(other.Surname)
                   ) &&
                   (
                       Active == other.Active ||
                       Active.Equals(other.Active)
                   ) &&
                   (
                       Initials == other.Initials ||
                       Initials != null &&
                       Initials.Equals(other.Initials)
                   ) &&
                   (
                       Email == other.Email ||
                       Email != null &&
                       Email.Equals(other.Email)
                   ) &&
                   (
                       SmUserId == other.SmUserId ||
                       SmUserId != null &&
                       SmUserId.Equals(other.SmUserId)
                   ) &&
                   (
                       AccountId == other.AccountId ||
                       AccountId != null &&
                       AccountId.Equals(other.AccountId)
                   ) &&
                   (
                       UserType == other.UserType ||
                       UserType != null &&
                       UserType.Equals(other.UserType)
                   ) &&
                   (
                       UserRoles == other.UserRoles ||
                       UserRoles != null &&
                       UserRoles.SequenceEqual(other.UserRoles)
                   ));
        }
 /// <summary>
 /// <see cref="System.Object.Equals(object)"/>
 /// </summary>
 public bool Equals(EnrichContactItem obj)
 {
     if (obj == null)
     {
         return(false);
     }
     return(EnrchTextDataId.Equals(obj.EnrchTextDataId) &&
            ContactId.Equals(obj.ContactId) && JsonData.Equals(obj.JsonData));
 }
        /// <summary>
        /// <see cref="System.Object.Equals(object)"/>
        /// </summary>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            EnrichContactItem objToCompare = obj as EnrichContactItem;

            if (objToCompare == null)
            {
                return(false);
            }
            return(EnrchTextDataId.Equals(objToCompare.EnrchTextDataId) && ContactId.Equals(objToCompare.ContactId) &&
                   JsonData.Equals(objToCompare.JsonData));
        }
 protected bool Equals(ContactNumber other)
 {
     return(ContactId.Equals(other.ContactId) && string.Equals(Description, other.Description) && string.Equals(TelephoneNumber, other.TelephoneNumber));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Determines whether the specified Object is equal to the current Object.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }


            var other = (VLContact)obj;

            //reference types
            if (!Object.Equals(Organization, other.Organization))
            {
                return(false);
            }
            if (!Object.Equals(Title, other.Title))
            {
                return(false);
            }
            if (!Object.Equals(Department, other.Department))
            {
                return(false);
            }
            if (!Object.Equals(FirstName, other.FirstName))
            {
                return(false);
            }
            if (!Object.Equals(LastName, other.LastName))
            {
                return(false);
            }
            if (!Object.Equals(Email, other.Email))
            {
                return(false);
            }
            if (!Object.Equals(Comment, other.Comment))
            {
                return(false);
            }
            //value types
            if (!ClientId.Equals(other.ClientId))
            {
                return(false);
            }
            if (!ListId.Equals(other.ListId))
            {
                return(false);
            }
            if (!ContactId.Equals(other.ContactId))
            {
                return(false);
            }
            if (!AttributeFlags.Equals(other.AttributeFlags))
            {
                return(false);
            }

            return(true);
        }