I have a tag list which contains a list of duplicated tags, such as "tag1", "tag1", "tag2", "tag3", "tag3" and "tag2".
I want to calculate and how many tag1, tag2 and tag3 are in the list, and then add them into a new tag list such as var tagList = new List<Tag>()
, it will have thousands of the tags in the list. Can anyone one help me to achieve this in an effective way? The list should have the tag name and the number of tags (count).
Here is the my Tag
class properties:
public int TagID { get; set; }
public string TagName { get; set; }
public int TagCount { get; set; }
Many thanks.