Exemplo n.º 1
0
        public int CountFindGroupsByKeywords(string name)
        {
            String          clave  = "CountFindGroup" + name;
            CacheItemPolicy policy = new CacheItemPolicy();

            policy.AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(5.0);
            object cacheCountGroups = (object)cache.Get(clave);
            int    countGroups;

            if (cacheCountGroups == null)
            {
                String[] keywords = name.Split(' ');
                countGroups = GroupDao.CountFindGroupsByName(keywords);
                cache.Add(clave, countGroups, policy);
            }
            else
            {
                countGroups = (int)cacheCountGroups;
            }

            return((int)countGroups);
        }