Ejemplo n.º 1
0
 public bool Send <T>(params T[] dataList) where T : AbstractEntity
 {
     if (_sendParam.Schema.CacheType == CacheType.Rank)
     {
         return(RedisConnectionPool.TryUpdateRankEntity(_sendParam.Key, dataList));
     }
     return(RedisConnectionPool.TryUpdateEntity(dataList));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 尝试从数据库中加载数据,并更新到Redis
 /// </summary>
 /// <returns></returns>
 public bool TryLoadFromDb <T>(TransReceiveParam receiveParam, out List <T> dataList) where T : AbstractEntity, new()
 {
     if (_dbTransponder.TryReceiveData(receiveParam, out dataList))
     {
         if (dataList.Count > 0)
         {
             //恢复到Redis
             return(RedisConnectionPool.TryUpdateEntity(dataList));
         }
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 尝试从数据库中加载数据,并更新到Redis
 /// </summary>
 /// <returns></returns>
 public bool TryLoadFromDb <T>(TransReceiveParam receiveParam, out List <T> dataList) where T : AbstractEntity, new()
 {
     if (_dbTransponder.TryReceiveData(receiveParam, out dataList))
     {
         if (dataList.Count > 0)
         {
             TraceLog.ReleaseWriteDebug("The data:{0} has been loaded {1} from db.", receiveParam.RedisKey, dataList.Count);
             //load to Redis
             return(RedisConnectionPool.TryUpdateEntity(dataList));
         }
         return(true);
     }
     return(false);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="entityList"></param>
 /// <returns></returns>
 protected bool TrySaveToRedis(IEnumerable <T> entityList)
 {
     return(RedisConnectionPool.TryUpdateEntity(entityList));
 }
Ejemplo n.º 5
0
 public void Send <T>(IEnumerable <T> dataList, bool isChange, string connectKey, EntityBeforeProcess handle) where T : AbstractEntity
 {
     RedisConnectionPool.TryUpdateEntity(dataList);
 }
 public bool Send <T>(params T[] dataList) where T : AbstractEntity
 {
     return(RedisConnectionPool.TryUpdateEntity(dataList));
 }