示例#1
0
        public ActionResult <List <TagCount> > GetCountOfAllTags()
        {
            List <TagCount> tagCountList = new List <TagCount>();
            List <Tag>      allTags      = tagDAO.GetAllTags();

            foreach (Tag tag in allTags)
            {
                int      count    = tagDAO.GetCountOfTagAcrossDatabase(tag.Id);
                TagCount tagCount = new TagCount
                {
                    Description = tag.Description,
                    Count       = count
                };
                tagCountList.Add(tagCount);
            }
            return(tagCountList);
        }