public void Reload()
        {
            var redisDb = _redis.GetDatabase();

            foreach (var(localeName, localeStrings) in _source.GetResponseStrings())
            {
                var hashFields = localeStrings
                                 .Select(x => new HashEntry(x.Key, x.Value))
                                 .ToArray();

                redisDb.HashSet($"{_creds.RedisKey()}:responses:{localeName}", hashFields);
            }

            foreach (var(localeName, localeStrings) in _source.GetCommandStrings())
            {
                var hashFields = localeStrings
                                 .Select(x => new HashEntry($"{x.Key}::args",
                                                            string.Join('&', Array.ConvertAll(x.Value.Args, HttpUtility.UrlEncode))))
                                 .Concat(localeStrings
                                         .Select(x => new HashEntry($"{x.Key}::desc", x.Value.Desc)))
                                 .ToArray();

                redisDb.HashSet($"{_creds.RedisKey()}:commands:{localeName}", hashFields);
            }
        }
Esempio n. 2
0
 public void Reload()
 {
     responseStrings = _source.GetResponseStrings();
     commandStrings  = _source.GetCommandStrings();
 }