title: Can Linq.Contains throw "Collection was modified; enumeration operation may not execute." exception?
body: <p>I have following code that adds some values to the dictionary. Can <code>Linq.Contains</code> methods throw <code>System.InvalidOperationException</code> <code>"Collection was modified; enumeration operation may not execute."</code> when item will be adding to the dictionary?</p>
  
  <pre><code>private static object _lock = new object();
  private static Dictionary&lt;Type, A&gt; _dic = new Dictionary&lt;Type, A&gt;();
  
  public static AddNewValue(Type t, A value)
  {
      if ( !_dic.Keys.Contains( t ) )
      {
          lock ( _lock )
          {
              if ( !_dic.Keys.Contains( t ) )
              {
                  _dic.Add( t, value );
              }
          }
      }
  }
  </code></pre>