Linq query group by distinct
<p>I have a linq query which is almost complete.
It's working but I need to retrieve the original list of the items in the list that fulfills the requirements.</p>

<p>Now it only returns true or false if any has the <code>count &gt; numberOfResourceToBook</code>.</p>

<p>But instead I want to return all the items in <code>availableTimes</code> having that (with all its properties).</p>

<pre><code>bool enoughResourceAvailable = availableTimes.GroupBy(l =&gt; new { l.From, l.To })
  .Select(g =&gt; new
  {
      Date = g.Key,
      Count = g.Select(l =&gt; l.ResourceId).Distinct().Count()
  }).Where(c =&gt; c.Count  &gt;= numberOfResourcesToBook).Count() &gt; 0;
</code></pre>