Let's say I have a list of objects and that I'm extracting and modifying an item from the list like this:
List<MyObject> TheListOfObjects = new List<MyObject>();
MyObject TheObject = new MyObject();
TheListOfObjects = //some json deserialization result
TheObject = (from o in TheListOfObject
where o.ID == SomeParameter
select o).SingleOrDefault();
TheObject.SomeProperty = SomeValue;
When I write TheObject.SomeProperty = SomeValue;
am I:
- modifying the item in the list and in which case I'm done or
- modifying a new item and I must replace the original item in the list with the item I just modified.