# C1.DataCollection.IDataCollectionEx.GroupAsync

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_DataCollection_IDataCollectionEx_GroupAsync_" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync*">GroupAsync Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_DataCollection_IDataCollectionEx_GroupAsync_" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_GroupAsync__1_C1_DataCollection_IDataCollection___0__System_String___" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync``1(C1.DataCollection.IDataCollection{``0},System.String[])">GroupAsync&lt;T&gt;(IDataCollection&lt;T&gt;, params string[])</h4>
<div class="markdown level1 summary"><p>Groups the data collection according to the specified group fields.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Task GroupAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, params string[] fields) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GroupAsync(Of T As Class)(dataCollection As IDataCollection(Of T), ParamArray fields As String()) As Task</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.DataCollection.IDataCollection-1.html">IDataCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">dataCollection</span></td>
      <td><p>The data collection.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>[]</td>
      <td><span class="parametername">fields</span></td>
      <td><p>The fields.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<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">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_DataCollection_IDataCollectionEx_GroupAsync_" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_GroupAsync__1_C1_DataCollection_IDataCollection___0__System_Linq_Expressions_Expression_System_Func___0_System_Object___" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync``1(C1.DataCollection.IDataCollection{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Object}})">GroupAsync&lt;T&gt;(IDataCollection&lt;T&gt;, Expression&lt;Func&lt;T, object&gt;&gt;)</h4>
<div class="markdown level1 summary"><p>Groups the data collection according to the specified group path.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Task GroupAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, Expression&lt;Func&lt;T, object&gt;&gt; groupPath) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GroupAsync(Of T As Class)(dataCollection As IDataCollection(Of T), groupPath As Expression(Of Func(Of T, Object))) As Task</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.DataCollection.IDataCollection-1.html">IDataCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">dataCollection</span></td>
      <td><p>The data collection.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.linq.expressions.expression-1">Expression</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a>&lt;T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;&gt;</td>
      <td><span class="parametername">groupPath</span></td>
      <td><p>The group path.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<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">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_DataCollection_IDataCollectionEx_GroupAsync_" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_GroupAsync__1_C1_DataCollection_IDataCollection___0__C1_DataCollection_GroupDescription___" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync``1(C1.DataCollection.IDataCollection{``0},C1.DataCollection.GroupDescription[])">GroupAsync&lt;T&gt;(IDataCollection&lt;T&gt;, GroupDescription[])</h4>
<div class="markdown level1 summary"><p>Groups the data collection according to the specified group descriptions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Task GroupAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, GroupDescription[] groupDescriptions) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GroupAsync(Of T As Class)(dataCollection As IDataCollection(Of T), groupDescriptions As GroupDescription()) As Task</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.DataCollection.IDataCollection-1.html">IDataCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">dataCollection</span></td>
      <td><p>The data collection.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.DataCollection.GroupDescription.html">GroupDescription</a>[]</td>
      <td><span class="parametername">groupDescriptions</span></td>
      <td><p>The group descriptions that determine how the data will be grouped.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<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">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_DataCollection_IDataCollectionEx_GroupAsync_" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_GroupAsync__1_C1_DataCollection_IDataCollection___0__C1_DataCollection_GroupDescription___System_Threading_CancellationToken_" data-uid="C1.DataCollection.IDataCollectionEx.GroupAsync``1(C1.DataCollection.IDataCollection{``0},C1.DataCollection.GroupDescription[],System.Threading.CancellationToken)">GroupAsync&lt;T&gt;(IDataCollection&lt;T&gt;, GroupDescription[], CancellationToken)</h4>
<div class="markdown level1 summary"><p>Groups the data collection according to the specified group descriptions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Task GroupAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, GroupDescription[] groupDescriptions, CancellationToken cancellationToken = default) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GroupAsync(Of T As Class)(dataCollection As IDataCollection(Of T), groupDescriptions As GroupDescription(), Optional cancellationToken As CancellationToken = Nothing) As Task</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.DataCollection.IDataCollection-1.html">IDataCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">dataCollection</span></td>
      <td><p>The data collection.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.DataCollection.GroupDescription.html">GroupDescription</a>[]</td>
      <td><span class="parametername">groupDescriptions</span></td>
      <td><p>The group descriptions that determine how the data will be grouped.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></td>
      <td><span class="parametername">cancellationToken</span></td>
      <td><p>The cancellation token.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<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">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
