示例#1
0
        public override int CompareTo(CosmosTypedValue other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }

            if (other is CosmosString otherCs)
            {
                return(string.Compare(Value, otherCs.Value, StringComparison.Ordinal));
            }

            throw new InvalidComparisonException(
                      $"Cannot compare a {GetType()} [{rawValue}] with {other.GetType()} [{other}]");
        }
示例#2
0
        public override int CompareTo(CosmosTypedValue other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }

            if (other is CosmosBoolean otherCb)
            {
                return(Value.CompareTo(otherCb.Value));
            }

            throw new InvalidComparisonException(
                      $"Cannot compare a {GetType()} [{rawValue}] with {other.GetType()} [{other}]");
        }