Example #1
0
 static BaseCacheStruct()
 {
     try
     {
         var schema = EntitySchemaSet.InitSchema(typeof(T));
         if (schema.IncreaseStartNo > 0)
         {
             string key = string.Format(PrimaryKeyFormat, schema.EntityName);
             RedisConnectionPool.SetNo(key, schema.IncreaseStartNo);
         }
         CacheFactory.RegistUpdateNotify(new DefaultCacheStruct <T>());
     }
     catch (Exception)
     { }
 }
Example #2
0
        /// <summary>
        /// 设置实体的编号
        /// </summary>
        /// <returns></returns>
        public void SetNextNo(long id)
        {
            string key = string.Format(PrimaryKeyFormat, typeof(T).Name);

            RedisConnectionPool.SetNo(key, id);
        }