title: Removing from linked list C#
body: <p>I'm trying to delete a node, if x currently matches a int in my linked list.</p>
  
  <p>I tried this, but once it removes the node it throws an error when examining foreach loop</p>
  
  <pre><code>public void DeleteNode(int x, LinkedList&lt;name&gt; myLinkedList) {
      foreach (name item in myLinkedList) {
           if (item.num.equals(x)) mylinkedList.Remove(x);
      }
  }
  </code></pre>
  
  <p>Hope that makes sense.</p>