private void AddInteral(RavenJToken key, PositionInFile position) { KeyToFilePos = KeyToFilePos.AddOrUpdate(key, position, (token, oldPos) => { WasteCount += 1; foreach (var index in SecondaryIndices) { index.Remove(oldPos.Key); } return(position); }); foreach (var index in SecondaryIndices) { index.Add(key); } }
private void AddInteral(RavenJToken key, PositionInFile position) { var ravenJObject = key as RavenJObject; if (ravenJObject != null) { ravenJObject.EnsureSnapshot(); } KeyToFilePos = KeyToFilePos.AddOrUpdate(key, position, (token, oldPos) => { WasteCount += 1; foreach (var index in SecondaryIndices) { index.Remove(oldPos.Key); } return(position); }); foreach (var index in SecondaryIndices) { index.Add(key); } }