I am trying to get the 1st (or second) item from a list. I don't want the reference as I want to change a couple of fields before adding it back in and I don't want to change the original.
For example:
I don't want myClass[0].name to be "Joe"
I don't want to clone the whole list, just one of the list items.
Thanks,
Tom
For example:
Code:
List<SomeClass> myClass = new List<SomeClass>();
myClass.Add(...);
myClass.Add(...);
SomeClass newClass;
newClass = myClass[0]; // this creates a pointer
newClass.name = "Joe";
I don't want myClass[0].name to be "Joe"
I don't want to clone the whole list, just one of the list items.
Thanks,
Tom