예제 #1
0
 public async Task <T> HGet <T>(string key, string field)
 {
     using (var cmd = factory.CreateCmd(CONST_VALURES.REDIS_COMMAND_HGET, key, field))
     {
         using (var client = await RedisClientManager.GetClient())
         {
             using (var result = await client.Send(cmd))
             {
                 if (result.Results != null)
                 {
                     var obj = pack.UnPack <T>(result.Results[0]);
                     return(obj);
                 }
                 else
                 {
                     return(default(T));
                 }
             }
         }
     }
 }