❔ Is there a way to make this neater?
I feel like I can do it with {get; set;} but idk how
20 Replies
basically just refactor it so that I don't need those methods if possible?
they're not required in the first place
you can just
Tags.Add
, Tags.Remove
as normal in your codeoh yeah true
Tags = Tags
does nothing
you could do private HashSet<string> Tags { get; } = new();
to avoid the null checks as well public HashSet<String> Tags { get; init; } = new()
for more "flexibility"ah thanks!
that's bogus
if they want it private, let them keep it private
oh i had it private because the functions were public
the functions are public so he needs public access for the add and remove
so its not bogus
whatever that is
that's just wrong
ok ok
bah no you're right my b
ok ok..
i misread
wait then how do i make it so that when initalizing my object that it can be added to using .Add and .Remove?
what do you mean?
are you running into any issues?
no but i dont like the feeling of how its written
welp i guess it isnt a big deal
how did you write it before?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.