示例#1
0
 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);
     }
 }
示例#2
0
        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);
            }
        }