Replace object but keep previous memory location in c#
<p>Let's say I have a list:</p>

<pre><code>List&lt;object&gt; list = new List();
list.Add(object1);
list.Add(object2);

object foo = list[0];
</code></pre>

<p>How do I make a call to list to replace list[0] such that foo will automatically point to the newly replaced object?</p>

<p>I know this line won't do the trick as foo will continue pointing to the old value of list[0]...</p>

<pre><code>list[0] = object3;
</code></pre>

<p>Thanks!</p>
