❔ Question about getter property of list
so, i have some class containg property of type:
List<string>
, how can i thread-safe return this list as some kind of snapshot of current state of list?
right now i'm doing it in followoing way but i'm not sure if it okey
5 Replies
a snapshot would be a copy
so looks fine at first glance
i dunno if i'd make it a property, because copying a list might be expensive in terms of what a property getter should do
do you have any other idea?
in theory, i need it for single iteration
make it a method instead
in few places i used
yield return
inside lockWas 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.