Ejemplo n.º 1
0
        public void FindIndex(string indexKey, object[] propertyValues, Action <string> action)
        {
            EntityIndexList indexList = new EntityIndexList();

            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey) && _entityIndexDict[indexKey] != null)
            {
                indexList = _entityIndexDict[indexKey];
            }
            string      indexItemKey = BaseEntity.CreateKeyCode(propertyValues);
            EntityIndex entityIndex  = indexList[indexItemKey];//当没有indexKey对应键值时,entityIndex为空

            if (entityIndex != null)
            {
                entityIndex.Foreach(action);
            }
            //TraceLog.Write("获得索引对象为空,缓存实体类:{0},索引键:{1},字典项Key:{2},字典容量:{3}",_cachekey, indexKey, indexItemKey, indexList.Count);
        }
Ejemplo n.º 2
0
        public void RemoveIndex(string indexKey, object[] propertyValues, string indexValue)
        {
            EntityIndexList indexList = new EntityIndexList();

            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey) && _entityIndexDict[indexKey] != null)
            {
                indexList = _entityIndexDict[indexKey];
            }
            indexList.Remove(propertyValues, indexValue);

            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey))
            {
                _entityIndexDict[indexKey] = indexList;
            }
            else if (_entityIndexDict != null)
            {
                _entityIndexDict.Add(indexKey, indexList);
            }
        }
Ejemplo n.º 3
0
        public void CreateIndex(string indexKey, object[] propertyValues, string indexValue)
        {
            if (_entityIndexDict == null)
            {
                throw new NullReferenceException(string.Format("索引{0}异常,索引字典对象为空!", indexKey));
            }
            EntityIndexList indexList = new EntityIndexList();
            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey) && _entityIndexDict[indexKey] != null)
            {
                indexList = _entityIndexDict[indexKey];
            }
            indexList.Add(propertyValues, indexValue);

            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey))
            {
                _entityIndexDict[indexKey] = indexList;
            }
            else if (_entityIndexDict != null)
            {
                _entityIndexDict.Add(indexKey, indexList);
            }
        }
Ejemplo n.º 4
0
        public void CreateIndex(string indexKey, object[] propertyValues, string indexValue)
        {
            if (_entityIndexDict == null)
            {
                throw new NullReferenceException(string.Format("索引{0}异常,索引字典对象为空!", indexKey));
            }
            EntityIndexList indexList = new EntityIndexList();

            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey) && _entityIndexDict[indexKey] != null)
            {
                indexList = _entityIndexDict[indexKey];
            }
            indexList.Add(propertyValues, indexValue);

            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey))
            {
                _entityIndexDict[indexKey] = indexList;
            }
            else if (_entityIndexDict != null)
            {
                _entityIndexDict.Add(indexKey, indexList);
            }
        }
Ejemplo n.º 5
0
 public void FindIndex(string indexKey, object[] propertyValues, Action<string> action)
 {
     EntityIndexList indexList = new EntityIndexList();
     if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey) && _entityIndexDict[indexKey] != null)
     {
         indexList = _entityIndexDict[indexKey];
     }
     string indexItemKey = BaseEntity.CreateKeyCode(propertyValues);
     EntityIndex entityIndex = indexList[indexItemKey];//当没有indexKey对应键值时,entityIndex为空
     if (entityIndex != null)
     {
         entityIndex.Foreach(action);
     }
     //TraceLog.Write("获得索引对象为空,缓存实体类:{0},索引键:{1},字典项Key:{2},字典容量:{3}",_cachekey, indexKey, indexItemKey, indexList.Count);
 }
Ejemplo n.º 6
0
        public void RemoveIndex(string indexKey, object[] propertyValues, string indexValue)
        {
            EntityIndexList indexList = new EntityIndexList();
            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey) && _entityIndexDict[indexKey] != null)
            {
                indexList = _entityIndexDict[indexKey];
            }
            indexList.Remove(propertyValues, indexValue);

            if (_entityIndexDict != null && _entityIndexDict.ContainsKey(indexKey))
            {
                _entityIndexDict[indexKey] = indexList;
            }
            else if (_entityIndexDict != null)
            {
                _entityIndexDict.Add(indexKey, indexList);
            }
        }