title: Check if list contains another list. C#
body: <p>EDIT, just saying the comment in the ContainsAllItem explains best.</p>
  
  <p>Im sorry for asking, I know this was asked before, but I just did not get it.
  Ok, so I want to check If a list contains all the items in another list <em>WITHOUT</em> overlapping, aswell as compare the items based on the classes string, name variable(called itemname and it is public).</p>
  
  <pre><code>public class Item
  {
      public string itemname;
  }
  </code></pre>
  
  <p>So basically, have a class(lets say.. class A) with a list of items, and a function that checks takes the list of items of class A, and then compares it to another list(lets call it B), but compare it by the itemname variable not the whole item.</p>
  
  <p>And most importantly could you explain in detail what it does.</p>
  
  <p>So how the function/class would look as of now.</p>
  
  <pre><code>public class SomeClass
  {
      public List&lt;Item&gt; myItems = new List&lt;Item&gt;();
  
      public bool ContainsAllItems(List&lt;Item&gt; B)
      {
          //Make a function that compares the to lists by itemname and only returns true if the myItems list contains ALL, items in list b.
          //Also could you explain how it works.
      }
  }
  </code></pre>