# C1.LiveLinq.Indexing.Search.GroupingQuery-2

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_LiveLinq_Indexing_Search_GroupingQuery_2" data-uid="C1.LiveLinq.Indexing.Search.GroupingQuery`2" class="text-break">GroupingQuery&lt;TKey, T&gt; Class
</h1>
  <div class="markdown level0 summary"><p>Represents a collection of <a class="xref" href="C1.LiveLinq.Indexing.Search.IndexedGroup-2.html">IndexedGroup&lt;TKey, T&gt;</a>, groups of elements with the same key, resulting from a search operation with grouping.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">GroupingQuery&lt;TKey, T&gt;</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="C1.LiveLinq.Indexing.Search.IndexedGroup-2.html">IndexedGroup</a>&lt;TKey, T&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.LiveLinq.Indexing.Search.html">C1.LiveLinq.Indexing.Search</a></h6>
  <h6><strong>Assembly</strong>: C1.LiveLinq.4.8.dll</h6>
  <h5 id="C1_LiveLinq_Indexing_Search_GroupingQuery_2_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract class GroupingQuery&lt;TKey, T&gt; : IEnumerable&lt;IndexedGroup&lt;TKey, T&gt;&gt;, IEnumerable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public MustInherit Class GroupingQuery(Of TKey, T)
    Implements IEnumerable(Of IndexedGroup(Of TKey, T)), IEnumerable</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">TKey</span></td>
        <td><p>The type of the index key.</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>The type of the elements of the indexed collection.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="C1_LiveLinq_Indexing_Search_GroupingQuery_2_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>The result of any index search operation, <a class="xref" href="C1.LiveLinq.Indexing.Search.IndexQuery-2.html">IndexQuery&lt;T, TKey&gt;</a> can be grouped by applying <a class="xref" href="C1.LiveLinq.Indexing.Search.IndexQuery-2.GroupByKey.html#C1_LiveLinq_Indexing_Search_IndexQuery_2_GroupByKey">GroupByKey()</a>.
It is grouped by the key that was used to perform the search operation. For example,</p>
<pre><code class="lang-csharp">customers.Indexes(c =&gt; c.City).All().GroupByKey();
customers.Indexes(c =&gt; c.City).FindBetween("A", "Z").GroupByKey();</code></pre>
</div>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_LiveLinq_Indexing_Search_GroupingQuery_2_GetEnumerator" data-uid="C1.LiveLinq.Indexing.Search.GroupingQuery`2.GetEnumerator">
          <a class="xref" href="C1.LiveLinq.Indexing.Search.GroupingQuery-2.GetEnumerator.html#C1_LiveLinq_Indexing_Search_GroupingQuery_2_GetEnumerator">GetEnumerator()</a>
        </td>
        <td class="markdown level1 summary"><p>Returns an enumerator that iterates through the <a class="xref" href="C1.LiveLinq.Indexing.Search.GroupingQuery-2.html">GroupingQuery&lt;TKey, T&gt;</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="extensionmethods">Extension Methods</h3>
  <div>
      <a class="xref" href="C1.LiveLinq.Hints.Indexed.html#C1_LiveLinq_Hints_Indexed__1___0_">Hints.Indexed&lt;T&gt;(T)</a>
  </div>
  <div>
      <a class="xref" href="C1.LiveLinq.Hints.Indexed.html#C1_LiveLinq_Hints_Indexed__1___0_C1_LiveLinq_IndexingHintAction_">Hints.Indexed&lt;T&gt;(T, IndexingHintAction)</a>
  </div>
  <div>
      <a class="xref" href="C1.LiveLinq.IndexedQueryExtensions.Join.html#C1_LiveLinq_IndexedQueryExtensions_Join__4_System_Collections_Generic_IEnumerable___0__C1_LiveLinq_Indexing_IIndexedSource___1__System_Linq_Expressions_Expression_System_Func___0___2___System_Linq_Expressions_Expression_System_Func___1___2___System_Linq_Expressions_Expression_System_Func___0___1___3___">IndexedQueryExtensions.Join&lt;TOuter, TInner, TKey, TResult&gt;(IEnumerable&lt;TOuter&gt;, IIndexedSource&lt;TInner&gt;, Expression&lt;Func&lt;TOuter, TKey&gt;&gt;, Expression&lt;Func&lt;TInner, TKey&gt;&gt;, Expression&lt;Func&lt;TOuter, TInner, TResult&gt;&gt;)</a>
  </div>
  <h3 id="seealso">See Also</h3>
  <div class="seealso">
      <div><a class="xref" href="C1.LiveLinq.Indexing.Search.IndexedGroup-1.html">IndexedGroup</a>&lt;T&gt;</div>
  </div>

</div>
