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

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     GivenName == other.GivenName ||
                     GivenName != null &&
                     GivenName.Equals(other.GivenName)
                 ) &&
                 (
                     Surname == other.Surname ||
                     Surname != null &&
                     Surname.Equals(other.Surname)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     Active == other.Active ||
                     Active != null &&
                     Active.Equals(other.Active)
                 ) &&
                 (
                     SmUserId == other.SmUserId ||
                     SmUserId != null &&
                     SmUserId.Equals(other.SmUserId)
                 ) &&
                 (
                     SmAuthorizationDirectory == other.SmAuthorizationDirectory ||
                     SmAuthorizationDirectory != null &&
                     SmAuthorizationDirectory.Equals(other.SmAuthorizationDirectory)
                 ) &&
                 (
                     UserRoles == other.UserRoles ||
                     UserRoles != null &&
                     UserRoles.SequenceEqual(other.UserRoles)
                 ) &&
                 (
                     District == other.District ||
                     District != null &&
                     District.Equals(other.District)
                 ));
        }
Example #2
0
        /// <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
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     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)
                 ) &&
                 (
                     Guid == other.Guid ||
                     Guid != null &&
                     Guid.Equals(other.Guid)
                 ) &&
                 (
                     SmAuthorizationDirectory == other.SmAuthorizationDirectory ||
                     SmAuthorizationDirectory != null &&
                     SmAuthorizationDirectory.Equals(other.SmAuthorizationDirectory)
                 ) &&
                 (
                     UserRoles == other.UserRoles ||
                     UserRoles != null &&
                     UserRoles.SequenceEqual(other.UserRoles)
                 ));
        }