updating an object in a list after an object changed
<p>I have a list of objects and I'm doing a foreach on the list and I'm sending each object to a method that modifies the object and returns it; like this:</p>

<pre><code>foreach (MyObjectModel o in TheMasterObject.ListOfMyObjectModel)
{
  o = MyMethod(o);
}
</code></pre>

<p>That doesn't work. What I want to do is replace the object I'm iterating on with the modified version that gets returned by MyMethod.</p>

<p>What do I need to change?</p>

<p>Thanks.</p>
