public void Delete(uint documentId) { lock (transactionLockObject) { if (isDisposed) { throw new ObjectDisposedException("Can't use Delete(id) after Dispose() or Delete()"); } if (isFieldIndexesInUse) { throw new InvalidOperationException("Can't use Delete(id) before disposing the enumerable from a FindDocumentIds call"); } if (DebugLogHandler != null) { DebugLogHandler("Delete: documentId=" + documentId); } if (documentId == metadataDocumentId) { throw new ArgumentException("Document " + documentId + " not found"); } TDocument val = Find(documentId); if (val == null) { throw new ArgumentException("Document " + documentId + " not found"); } journalWriter.Start(); try { packedFile.Remove(documentId); fieldIndexes.Delete(val); journalWriter.Finish(); journalPlayer.Play(); } catch (Exception) { journalWriter.Discard(); throw; } } }
public void Remove(BinaryReader reader) { uint documentId = reader.ReadUInt32(); packedFile.Remove(documentId); }