So I have a list:
List<Class> myList = new List<Class>
I create an object that is equal to one of the items so that I can update it:
Class item = myList[0]
I also have a copy of the item (so that I can restore any changes if needed):
Class copyItem = myList[0]
When I update the item
the item in myList
also updates, which is what I want.
But I don't want this to happen with the copyItem
, how do I make it so that the copy doesn't reference the myList
?