Exemplo n.º 1
0
        /// <summary>
        /// Gets all tags
        /// </summary>
        /// <returns></returns>
        public TagCollection GetAllTags()
        {
            TagCollection tc = ZCache.Get <TagCollection>("AllTags");

            if (tc == null)
            {
                tc = new TagCollection();

                TagCollection temp = TagCollection.FetchAll();

                foreach (Tag t in temp)
                {
                    Tag tag = tc.Find(
                        delegate(Tag tempTag)
                    {
                        return(tempTag.Name == t.Name);
                    });

                    if (tag == null)
                    {
                        tc.Add(t);
                    }
                }

                ZCache.InsertCache("AllTags", tc, 90);
            }

            return(tc);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets all tags
        /// </summary>
        /// <returns></returns>
        public TagCollection GetAllTags()
        {
            TagCollection tc = ZCache.Get<TagCollection>("AllTags");

            if (tc == null)
            {
                tc = new TagCollection();

                TagCollection temp = TagCollection.FetchAll();

                foreach (Tag t in temp)
                {
                    Tag tag = tc.Find(
                                        delegate(Tag tempTag)
                                        {
                                            return tempTag.Name == t.Name;
                                        });

                    if (tag == null)
                        tc.Add(t);
                }

                ZCache.InsertCache("AllTags", tc, 90);
            }

            return tc;
        }