title: Is it possible to delete objects in C#?
body: <p>I have a list of <code>Account</code> objects stored in <code>AccountList</code>. Now I want to remove a <code>Account</code> so, that I also can not add it to the list again if I still have that object - meaning the object shouldn't exist at all anymore.</p>
  <p>In my Code I go through the <code>AccountList</code> list and search for the <code>Account</code> with the matching <code>id</code>. Then, when the matching <code>Account</code> was found, that <code>Account</code> should be deleted (and therefore also be removed from <code>AccountList</code>).</p>
  <pre><code>public bool Delete_Account(int id)
  {
      foreach (var account in AccountList)
      {
          if (account.id == id)
          {
              //delete Account object here
              return true;
          }
      }
      return false;
  }
  </code></pre>
  <p>Is this possible in C# and if not, how would I achieve what I want to do?</p>