internal IndexCreator(TableCache parent, string indexKeyInCache, SearchConditions searchConditions)
 {
     _parent = parent;
     _index = new TableIndex(searchConditions);
     _indexKey = searchConditions.Key;
     _indexKeyInCache = indexKeyInCache;
 }
 internal EnyimIndexCreator(EnyimTableCache parent, string indexKeyInCache, SearchConditions searchConditions)
 {
     this._parent = parent;
     this._index = new TableIndex(searchConditions);
     this._indexKey = searchConditions.Key;
     this._indexKeyInCache = indexKeyInCache;
 }
            public void AddEntityToIndex(EntityKey entityKey, Document doc)
            {
                string key = this._parent.GetEntityKeyInCache(entityKey);
                if (key.Length > MaxKeyLength)
                {
                    this._index = null;
                    return;
                }

                // adding key to index (it's essential to do this _before_ checking the key length - the index should fail to be read next time)
                this._index.Index.Add(entityKey);

                // Putting the entity to cache, but only if it doesn't exist there.
                // That's because when loading from DynamoDb whe should never overwrite local updates.
                this._parent._cacheClient.Store(StoreMode.Add, key, new CacheDocumentWrapper(doc), this._parent._ttl);
            }