BTDB.ODBLayer.ObjectDB.AllocateNewOid C# (CSharp) Méthode

AllocateNewOid() private méthode

private AllocateNewOid ( ) : ulong
Résultat ulong
        internal ulong AllocateNewOid()
        {
            return (ulong)Interlocked.Increment(ref _lastObjId);
        }

Usage Example

Exemple #1
0
 public ulong GetSingletonOid(uint id)
 {
     using (var tr = _keyValueDB.StartTransaction())
     {
         tr.SetKeyPrefix(TableSingletonsPrefix);
         var key = new byte[PackUnpack.LengthVUInt(id)];
         var ofs = 0;
         PackUnpack.PackVUInt(key, ref ofs, id);
         if (tr.FindExactKey(key))
         {
             return(new KeyValueDBValueReader(tr).ReadVUInt64());
         }
         return(_objectDB.AllocateNewOid());
     }
 }
All Usage Examples Of BTDB.ODBLayer.ObjectDB::AllocateNewOid