C#C
C#3y ago
Kai

❔ Is there a way to make this neater?

    public void AddTags(string tag)
    {
        Tags?.Add(tag);
        Tags = Tags;
    }

    public void RemoveTag(string tag)
    {
        Tags?.Remove(tag);
        Tags = Tags;
    }
    
    private HashSet<String>? Tags { get; set; }
I feel like I can do it with {get; set;} but idk how
Was this page helpful?