コード例 #1
0
        /// <summary>
        /// Compares this <see cref="SystemAssignedIdentity"/> with another instance.
        /// </summary>
        /// <param name="other"> <see cref="SystemAssignedIdentity"/> object to compare. </param>
        /// <returns> -1 for less than, 0 for equals, 1 for greater than. </returns>
        public int CompareTo(SystemAssignedIdentity other)
        {
            if (other == null)
            {
                return(1);
            }

            int compareResult = 0;

            if ((compareResult = TenantId.GetValueOrDefault().CompareTo(other.TenantId.GetValueOrDefault())) == 0 &&
                (compareResult = PrincipalId.GetValueOrDefault().CompareTo(other.PrincipalId.GetValueOrDefault())) == 0)
            {
                return(0);
            }

            return(compareResult);
        }