title: C# - Update list item with new object values
body: <p>I have an <code>object</code> which has some properties and a few of those properties are <code>Lists</code>. Each list contains instances of other classes. What i want to do is take the first item from a list and overwrite those property values.</p>
  
  <p>Here's a pseudo example of what i have:</p>
  
  <pre><code>public class User
  {
      public List&lt;Address&gt; Addresses = new List&lt;Address&gt;();
  
      public User ( )
      {
          Addresses = fill with data;
      }
  }
  
  
  public class TestUser
  {
      public User user; // Is filled somewhere in this class
  
      public void TestUpdateList ( Address addr )
      {
          // The param "addr" contains new values
          // These values must ALWAYS be placed in the first item
          // of the "Addresses" list.
  
          // Get the first Address object and overwrite that with
          // the new "addr" object
          user.Addresses[0] = addr; // &lt;-- doesn't work, but should give you an idea
      }
  }
  </code></pre>
  
  <p>I hope this example shed some light on what i want to do.</p>
  
  <p>So i am basically looking for a way to "update" an existing item in a list, which is in this case an <code>object</code>.</p>