Exemplo n.º 1
0
        /// <summary>
        /// 插入实体,id作为key主要标识,过期时间60秒
        /// </summary>
        /// <param name="id"></param>
        /// <param name="xXXAo"></param>
        /// <returns></returns>
        public async Task <ResponseResult <bool> > SetAsync(uint id, XXXAo xXXAo)
        {
            var result = await _redisManager.SetAsync($"RedisOption:Id{id}", xXXAo);

            return(new ResponseResult <bool>
            {
                Result = result,
            });
        }
Exemplo n.º 2
0
 /// <summary>
 /// 注册服务实例
 /// </summary>
 /// <param name="serviceDesc">要注册的服务实例</param>
 public async Task Register(ServiceDescription serviceDesc)
 {
     string key = GetKey(serviceDesc.ServiceName, serviceDesc.Id);
     await _redisManager.SetAsync(key, serviceDesc, ServiceEchoTTLSeconds).ConfigureAwait(false);
 }