TryFind() публичный Метод

Searches for a key and points the Cursor to this key
This method wraps the native ups_cursor_find function.
Searches for an item in the Database and points the Cursor to this item. If the item could not be found, the Cursor is not modified and the return value is null.
If the key has multiple duplicates, the Cursor is positioned on the first duplicate.
public TryFind ( byte key ) : byte[]
key byte The key to search for
Результат byte[]
Пример #1
0
 private void TryFind()
 {
     Cursor c = new Cursor(db);
     byte[] k1 = new byte[5]; k1[0] = 5;
     byte[] k2 = new byte[5]; k2[0] = 6;
     byte[] k3 = new byte[5]; k3[0] = 7;
     byte[] r1 = new byte[5]; r1[0] = 1;
     byte[] r2 = new byte[5]; r2[0] = 2;
     db.Insert(k1, r1);
     db.Insert(k2, r2);
     var f = c.TryFind(k1);
     checkEqual(r1, f);
     var g = c.TryFind(k2);
     checkEqual(r2, g);
     var h = c.TryFind(k3);
     Assert.IsNull(h);
 }