title: Linq Include/Exclude logic
body: <p>I have an include list containing Name and TypeId, and I want to create an exclude list from it for a given item with some TypeId. but the catch is if a Name does not appear in the list at all then it is not excluded from any type.</p>
  
  <p>How do I do this with linq?</p>
  
  <pre><code>       List&lt;NameTypeFilter&gt; includeList = new List&lt;NameTypeFilter&gt;();
          includeList.Add(new NameTypeFilter
          {
              Name = "N1",
              Type = "T1"
          });
  
  
          MyItem myItem1 = new MyItem();
          myItem1.Type = "T1";
  
          MyItem myItem2 = new MyItem();
          myItem1.Type = "T2";
  
          MyItem myItem3 = new MyItem();
          myItem1.Type = "T3";
  
          //  excludelist for myItem1 should contain nothing
          //  excludelist for myItem2 should contain N1
          //  excludelist for myItem3 should contain N1
  
          includeList.Add(new NameTypeFilter
          {
              Name = "N2",
              Type = "T2"
          });
  
          //  excludelist for myItem1 should contain N2
          //  excludelist for myItem2 should contain N1
          //  excludelist for myItem3 should contain N1,N2
  </code></pre>