Пример #1
0
 public GlobalSecondaryIndexes(List <IndexDefinition> definitions)
 {
     indexes = new ConcurrentSortedDictionary <string, GlobalSecondaryIndex>();
     foreach (var indexDefinition in definitions)
     {
         indexes.TryAdd(indexDefinition.Name, new GlobalSecondaryIndex(indexDefinition));
     }
 }
Пример #2
0
        public JToken Put(string sortKey, JToken item)
        {
            if (data.TryGetValue(sortKey, out var value))
            {
                return(data.TryUpdate(sortKey, item)
                    ? item
                    : value);
            }

            return(data.TryAdd(sortKey, item)
                ? item
                : null);
        }