/// <summary> /// The method that will convert a tag count connection into tag count object used in the html page /// </summary> /// <param name="tag">the tag count connection object</param> /// <returns>the tag count connection object used in html page</returns> private static List <TagCount> ConvertToTagCount(TagCountConnection tag) { List <TagCount> listTags = new List <TagCount>(); // Convert the Tag Count Connection to the Tag Count object foreach (TagConnection item in tag.tags) { string classTag = GetTagClass(item.count, tag.nr_connections); Tag tagTmp = new Tag() { Name = item.tag }; TagCount tagCountTmp = new TagCount() { Tag = tagTmp, TotalUsers = item.count, TagClass = classTag }; listTags.Add(tagCountTmp); } return(listTags); }
/// <summary> /// The method to get the overall connection tag count for the registered user /// </summary> /// <returns>an object that associates the connection tag and the count</returns> private static async Task <List <TagCount> > GetAuthenticatedConnectionTagCount(string username) { TagCountConnection tag = await Services.GetTagCountConnectionByUser(username); return(ConvertToTagCount(tag)); }
/// <summary> /// The method to get the overall connection tag count /// </summary> /// <returns>an object that associates the connection tag and the count</returns> private static async Task <List <TagCount> > GetOverallConnectionTagCount() { TagCountConnection tag = await Services.GetTagCountConnection(); return(ConvertToTagCount(tag)); }