示例#1
0
        public bool GetByKey(string key, out IDictionary value)
        {
            Logger.Log(
                "Trying to get item against Key '" + key + "'",
                Microsoft.Extensions.Logging.LogLevel.Trace
                );
            IDictionary resultSet = new Hashtable();
            object      listKeys  = _nCache.Get(key);

            try
            {
                if (listKeys != null)
                {
                    var keys = listKeys as string[];
                    if (keys == null)
                    {
                        CacheEntry entry = listKeys as CacheEntry;

                        resultSet.Add(key, listKeys);
                    }
                    else
                    {
                        resultSet = _nCache.GetBulk(keys);
                    }
                }
            }
            catch (Exception e)
            {
                //casting exception
            }
            value = resultSet;
            return(resultSet.Count > 0);
        }