title: How to synchronize the access to a List<T> used in ASP.NET?
body: <p>I have some problems on a site with the concurrent access to a list. This list keeps a cart of items, and multiple deletes are crashing the site.
  <strong>Which is the best method to sync them?</strong> 
  Is a lock enough?
  The lock option seems to be ugly because the code is spread all over the place and is pretty messy.</p>
  
  <p>Update:
  This is a list implemented like this:
  public class MyList : List&lt; SomeCustomType> { }</p>
  
  <p>This is a legacy site so not so many modifications are allowed to it.
  How should I refactor this in order to safely lock when iterating over it ?</p>
  
  <p>any idea!</p>