title: Using LINQ to get all property with the exact same value?
body: <p>I have a list of data like this:</p>
  
  <pre><code>Prod1: Id=1,  Name="Book",    Active=true
  Prod2: Id=2,  Name="Book",    Active=false
  Prod3: Id=3,  Name="Book",    Active=true
  Prod4: Id=4,  Name="Laptop",  Active=true
  Prod5: Id=5,  Name="Laptop",  Active=true
  Prod6: Id=6,  Name="Laptop",  Active=true
  </code></pre>
  
  <p>What I want to perform is to get reduced list like this:</p>
  
  <pre><code>Prod1: Id=4, Name="Laptop", Active=true
  </code></pre>
  
  <p>What I am trying to do is that I need to select all products group by its Name, and return all that has true. Since Book has one false, it should not return Book. </p>
  
  <p>I've tried this one:</p>
  
  <pre><code>lstProducts = lstProducts 
                  .Where(x =&gt;
                      lstProducts 
                     .All(c =&gt; c.Name == x.Name &amp;&amp; c.Active == true))
                  .GroupBy(c =&gt; c.Name).Select(c =&gt; c.First())
                  .ToList();
  </code></pre>
  
  <p>But its returning zero results. If I do a <code>where clause where Active == true</code>, its getting a Book product, which shouldn't since all of its Active should be true in order to get it. </p>