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

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((IsCanceled == other.IsCanceled || IsCanceled != null && IsCanceled.Equals(other.IsCanceled)) &&
                   (IsError == other.IsError || IsError != null && IsError.Equals(other.IsError)) &&
                   (ErrorCode == other.ErrorCode || ErrorCode != null && ErrorCode.Equals(other.ErrorCode)) &&
                   (AccessToken == other.AccessToken || AccessToken != null && AccessToken.Equals(other.AccessToken)) &&
                   (IdToken == other.IdToken || IdToken != null && IdToken.Equals(other.IdToken)) &&
                   (Scopes == other.Scopes || Scopes != null && Scopes.Equals(other.Scopes)) &&
                   (ExpiresOn == other.ExpiresOn || ExpiresOn != null && ExpiresOn.Equals(other.ExpiresOn)));
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is ObtainTokenRequest other &&
                   ((ClientId == null && other.ClientId == null) || (ClientId?.Equals(other.ClientId) == true)) &&
                   ((ClientSecret == null && other.ClientSecret == null) || (ClientSecret?.Equals(other.ClientSecret) == true)) &&
                   ((Code == null && other.Code == null) || (Code?.Equals(other.Code) == true)) &&
                   ((RedirectUri == null && other.RedirectUri == null) || (RedirectUri?.Equals(other.RedirectUri) == true)) &&
                   ((GrantType == null && other.GrantType == null) || (GrantType?.Equals(other.GrantType) == true)) &&
                   ((RefreshToken == null && other.RefreshToken == null) || (RefreshToken?.Equals(other.RefreshToken) == true)) &&
                   ((MigrationToken == null && other.MigrationToken == null) || (MigrationToken?.Equals(other.MigrationToken) == true)) &&
                   ((Scopes == null && other.Scopes == null) || (Scopes?.Equals(other.Scopes) == true)) &&
                   ((ShortLived == null && other.ShortLived == null) || (ShortLived?.Equals(other.ShortLived) == true)));
        }