Пример #1
0
        public static List <MiscEntity> GetMisc(MiscEnum misc)
        {
            var    memoryCache = MemoryCache.Default;
            string key         = string.Format("Get_{0}", misc.ToString());

            if (!memoryCache.Contains(key))
            {
                var result = JsonHelper.FromJson <List <MiscEntity> >(JanusClientHelper.GetMisc(misc));
                memoryCache.Add(key, result, new CacheItemPolicy()
                {
                    Priority = CacheItemPriority.NotRemovable
                });
            }
            return(memoryCache.Get(key, null) as List <MiscEntity>);
        }
Пример #2
0
        public static string GetMisc(MiscEnum misc)
        {
            string requestId = Guid.NewGuid().ToString();
            string url       = JanusClientHelper.DataService + string.Format("reference/" + misc.ToString());

            var result = HttpClientHolder.GetRequest(url);

            return(result);
        }