Ejemplo n.º 1
0
 public async Task Create(UserDto userDto)
 {
     await _luaScript.ExecLuaScript(
         LuaScript.Create,
         new RedisKey[] { Prefix + userDto.Id },
         new RedisValue[] { userDto.Id, userDto.Code, userDto.Email, userDto.Name, userDto.Password }
         );
 }
Ejemplo n.º 2
0
        public async Task <int> Create(UserEntity userEntity)
        {
            await _luaScript.ExecLuaScript(
                LuaScript.Create,
                new RedisKey[] { Prefix + userEntity.Id },
                new RedisValue[] { userEntity.Id, userEntity.Code, userEntity.Email, userEntity.Name, userEntity.Password }
                );

            return(userEntity.Id);
        }
Ejemplo n.º 3
0
        public async Task <IEnumerable <CurrencyEntity> > GetCurrencyAll()
        {
            var currencies = new List <CurrencyEntity>();

            var data = (string[])await _luaScript.ExecLuaScript(
                GetAllCurrencies,
                new RedisKey[] { "CurrencyAll" }
                );

            for (var pos = 0; pos < data.Length; pos += 2)
            {
                currencies.Add(new CurrencyEntity
                {
                    CurrencyCode = data[pos],
                    CurrencyRate = data[pos + 1]
                });
            }

            return(currencies);
        }