Exemplo n.º 1
0
        public static void EsansyelVarlıklarYükle()
        {
            try
            {
                Task.Run(async() =>
                {
                    try
                    {
                        await GünlükKaydetme(OlaySeviye.Ayıklama, "Getting all iller with sub...");

                        MemCache.Set("İller", await İllerAl());

                        List <İl> sdciller;
                        MemCache.TryGetValue("İller", out sdciller);
                        var nIller = sdciller != null ? $"{sdciller.Count}" : "(NULL)";
                        await GünlükKaydetme(OlaySeviye.Ayıklama, $"Got: {nIller}");

                        BaşkaİdariBölümlerAl();

                        //var mmch = MemCache != null ? "OK" : "(NULL)";
                        //await GünlükKaydetme(OlaySeviye.Ayıklama, $"MemCache: {mmch}");

                        //MemCache.Set("Tümİller", alliller);// await İlçelerOlanİllerAl());
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
 public void AddOrUpdate_ValuePassedIn_ShouldAddToCache(string key, string value)
 {
     _memCache.AddOrUpdate(key, value);
     _memCache.TryGetValue(key, out var dataAdded);
     Assert.AreEqual(value, dataAdded);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Gets the value from the cache, or null
 /// </summary>
 /// <returns>The value or null</returns>
 public async Task <T> TryGetValueAsync(string subkey) => (await m_parent.TryGetValue(GetKeyForSubkey(subkey))) as T;
Exemplo n.º 4
0
 /// <summary>
 /// Gets the value from the cache, or null
 /// </summary>
 /// <returns>The value or null</returns>
 public async Task <T> TryGetValueAsync() => (await m_parent.TryGetValue(m_key)) as T;