Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Wrote my own LSN comparer in the end:</p> <pre><code>public class CdcLsnValue : IEquatable&lt;CdcLsnValue&gt; { public byte[] Bytes; private const int Size = 10; public CdcLsnValue() { Bytes = null; } public CdcLsnValue(byte[] lsn) { if (lsn == null) { Bytes = null; return; } if(lsn.Length != Size) throw new ArgumentOutOfRangeException("lsn"); Bytes = (byte[]) lsn.Clone(); } public static bool operator ==(CdcLsnValue left, CdcLsnValue right) { if (ReferenceEquals(left, right)) return true; if (ReferenceEquals(null, left)) return false; if (ReferenceEquals(null, right)) return false; for (int i = 0; i &lt; Size; i++) { if (left.Bytes[i] == right.Bytes[i]) continue; return false; } return true; } public static bool operator !=(CdcLsnValue left, CdcLsnValue right) { return !(left == right); } public static bool operator &lt;=(CdcLsnValue left, CdcLsnValue right) { if (ReferenceEquals(null, left)) return false; if (ReferenceEquals(null, right)) return false; for (int i = 0; i &lt; Size; i++) { if (left.Bytes[i] &lt;= right.Bytes[i]) continue; return false; } return true; } public static bool operator &gt;=(CdcLsnValue left, CdcLsnValue right) { if (ReferenceEquals(null, left)) return false; if (ReferenceEquals(null, right)) return false; for (int i = 0; i &lt; Size; i++) { if (left.Bytes[i] &gt;= right.Bytes[i]) continue; return false; } return true; } public static bool operator &lt;(CdcLsnValue left, CdcLsnValue right) { if (ReferenceEquals(null, left)) return false; if (ReferenceEquals(null, right)) return false; if (left == right) return false; return left &lt;= right; } public static bool operator &gt;(CdcLsnValue left, CdcLsnValue right) { return !(left &lt; right); } public bool Equals(CdcLsnValue other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Bytes, Bytes); } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != typeof(CdcLsnValue)) return false; return Equals((CdcLsnValue)obj); } public override int GetHashCode() { return (Bytes != null ? Bytes.GetHashCode() : 0); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload