App_Code.Controls.TagCloud.CreateRawList C# (CSharp) Method

CreateRawList() private static method

Builds a raw list of all tags and the number of times they have been added to a post.
private static CreateRawList ( ) : int>.SortedDictionary
return int>.SortedDictionary
        private static SortedDictionary<string, int> CreateRawList()
        {
            var dic = new SortedDictionary<string, int>();
            foreach (var tag in Post.Posts.Where(post => post.IsVisibleToPublic).SelectMany(post => post.Tags))
            {
                if (dic.ContainsKey(tag))
                {
                    dic[tag]++;
                }
                else
                {
                    dic[tag] = 1;
                }
            }

            return dic;
        }