Beispiel #1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (ClientId != null)
                {
                    hashCode = hashCode * 59 + ClientId.GetHashCode();
                }
                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }
                if (AllowedGrantTypes != null)
                {
                    hashCode = hashCode * 59 + AllowedGrantTypes.GetHashCode();
                }
                if (RedirectUris != null)
                {
                    hashCode = hashCode * 59 + RedirectUris.GetHashCode();
                }
                if (AllowedCorsOrigins != null)
                {
                    hashCode = hashCode * 59 + AllowedCorsOrigins.GetHashCode();
                }
                if (PostLogoutRedirectUris != null)
                {
                    hashCode = hashCode * 59 + PostLogoutRedirectUris.GetHashCode();
                }
                if (AllowedScopes != null)
                {
                    hashCode = hashCode * 59 + AllowedScopes.GetHashCode();
                }
                if (ClientSecrets != null)
                {
                    hashCode = hashCode * 59 + ClientSecrets.GetHashCode();
                }
                if (HashedClientSecrets != null)
                {
                    hashCode = hashCode * 59 + HashedClientSecrets.GetHashCode();
                }

                hashCode = hashCode * 59 + AllowedOfflineAccess.GetHashCode();

                hashCode = hashCode * 59 + AccessTokenLifetime.GetHashCode();

                hashCode = hashCode * 59 + IdentityTokenLifetime.GetHashCode();

                hashCode = hashCode * 59 + RequireConsent.GetHashCode();
                return(hashCode);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Returns true if Oauth2ClientSubmit instances are equal
        /// </summary>
        /// <param name="other">Instance of Oauth2ClientSubmit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Oauth2ClientSubmit other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ClientId == other.ClientId ||
                     ClientId != null &&
                     ClientId.Equals(other.ClientId)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     AllowedGrantTypes == other.AllowedGrantTypes ||
                     AllowedGrantTypes != null &&
                     other.AllowedGrantTypes != null &&
                     AllowedGrantTypes.SequenceEqual(other.AllowedGrantTypes)
                 ) &&
                 (
                     RedirectUris == other.RedirectUris ||
                     RedirectUris != null &&
                     other.RedirectUris != null &&
                     RedirectUris.SequenceEqual(other.RedirectUris)
                 ) &&
                 (
                     AllowedCorsOrigins == other.AllowedCorsOrigins ||
                     AllowedCorsOrigins != null &&
                     other.AllowedCorsOrigins != null &&
                     AllowedCorsOrigins.SequenceEqual(other.AllowedCorsOrigins)
                 ) &&
                 (
                     PostLogoutRedirectUris == other.PostLogoutRedirectUris ||
                     PostLogoutRedirectUris != null &&
                     other.PostLogoutRedirectUris != null &&
                     PostLogoutRedirectUris.SequenceEqual(other.PostLogoutRedirectUris)
                 ) &&
                 (
                     AllowedScopes == other.AllowedScopes ||
                     AllowedScopes != null &&
                     other.AllowedScopes != null &&
                     AllowedScopes.SequenceEqual(other.AllowedScopes)
                 ) &&
                 (
                     ClientSecrets == other.ClientSecrets ||
                     ClientSecrets != null &&
                     other.ClientSecrets != null &&
                     ClientSecrets.SequenceEqual(other.ClientSecrets)
                 ) &&
                 (
                     HashedClientSecrets == other.HashedClientSecrets ||
                     HashedClientSecrets != null &&
                     other.HashedClientSecrets != null &&
                     HashedClientSecrets.SequenceEqual(other.HashedClientSecrets)
                 ) &&
                 (
                     AllowedOfflineAccess == other.AllowedOfflineAccess ||

                     AllowedOfflineAccess.Equals(other.AllowedOfflineAccess)
                 ) &&
                 (
                     AccessTokenLifetime == other.AccessTokenLifetime ||

                     AccessTokenLifetime.Equals(other.AccessTokenLifetime)
                 ) &&
                 (
                     IdentityTokenLifetime == other.IdentityTokenLifetime ||

                     IdentityTokenLifetime.Equals(other.IdentityTokenLifetime)
                 ) &&
                 (
                     RequireConsent == other.RequireConsent ||

                     RequireConsent.Equals(other.RequireConsent)
                 ));
        }