示例#1
0
        // Helper routine to convert the sequence number to a string representation.
        public static string SequenceNumberToString(SequenceNumber sqn)
        {
            byte[] bytes       = sqn.GetBytes();
            long   realLsnHigh = BitConverter.ToInt64(bytes, 0);

            if (bytes.Length == 8)
            {
                return(realLsnHigh.ToString());
            }
            else
            {
                long realLsnLow = BitConverter.ToInt64(bytes, 8);
                return(realLsnLow.ToString() + "-" + realLsnHigh.ToString());
            }
        }
示例#2
0
        // Helper routine to convert the sequence number to a string representation.
        public static string SequenceNumberToString(SequenceNumber sqn)
        {
            byte[] bytes = sqn.GetBytes();
            long realLsnHigh = BitConverter.ToInt64(bytes, 0);

            if (bytes.Length == 8)
            {
                return realLsnHigh.ToString();
            }
            else
            {
                long realLsnLow = BitConverter.ToInt64(bytes, 8);
                return realLsnLow.ToString() + "-" + realLsnHigh.ToString();
            }
        }
示例#3
0
 public static string Identifier(this SequenceNumber sequence)
 =>
 sequence == SequenceNumber.Invalid
             ? "INVALID"
             : string.Concat(sequence.GetBytes().Select(_ => _.ToString("X")));