# C1.DataCollection.IDataCollectionEx.FilterAsync

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_DataCollection_IDataCollectionEx_FilterAsync_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync*">FilterAsync Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_DataCollection_IDataCollectionEx_FilterAsync_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_FilterAsync__1_C1_DataCollection_IDataCollection___0__System_Linq_Expressions_Expression_System_Func___0_System_Object___C1_DataCollection_FilterOperation_System_Object_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync``1(C1.DataCollection.IDataCollection{``0},System.Linq.Expressions.Expression{System.Func{``0,System.Object}},C1.DataCollection.FilterOperation,System.Object)">FilterAsync&lt;T&gt;(IDataCollection&lt;T&gt;, Expression&lt;Func&lt;T, object&gt;&gt;, FilterOperation, object)</h4>
<div class="markdown level1 summary"><p>Filters the data using specified filter parameters.</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 FilterAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, Expression&lt;Func&lt;T, object&gt;&gt; filterPath, FilterOperation filterOperation, object value) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FilterAsync(Of T As Class)(dataCollection As IDataCollection(Of T), filterPath As Expression(Of Func(Of T, Object)), filterOperation As FilterOperation, value As 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">filterPath</span></td>
      <td><p>The path of the data item to which the filter will be applied.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.DataCollection.FilterOperation.html">FilterOperation</a></td>
      <td><span class="parametername">filterOperation</span></td>
      <td><p>The filter operation.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value used in the expression.</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_FilterAsync_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_FilterAsync__1_C1_DataCollection_IDataCollection___0__System_String_C1_DataCollection_FilterOperation_System_Object_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync``1(C1.DataCollection.IDataCollection{``0},System.String,C1.DataCollection.FilterOperation,System.Object)">FilterAsync&lt;T&gt;(IDataCollection&lt;T&gt;, string, FilterOperation, object)</h4>
<div class="markdown level1 summary"><p>Filters the data using specified filter parameters.</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 FilterAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, string filterPath, FilterOperation filterOperation, object value) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FilterAsync(Of T As Class)(dataCollection As IDataCollection(Of T), filterPath As String, filterOperation As FilterOperation, value As 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.string">string</a></td>
      <td><span class="parametername">filterPath</span></td>
      <td><p>The path of the data item to which the filter will be applied.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.DataCollection.FilterOperation.html">FilterOperation</a></td>
      <td><span class="parametername">filterOperation</span></td>
      <td><p>The filter operation.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value used in the expression.</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_FilterAsync_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_FilterAsync__1_C1_DataCollection_IDataCollection___0__System_String_System_Boolean_System_Boolean_System_Boolean_System_Boolean_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync``1(C1.DataCollection.IDataCollection{``0},System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean)">FilterAsync&lt;T&gt;(IDataCollection&lt;T&gt;, string, bool, bool, bool, bool)</h4>
<div class="markdown level1 summary"><p>Filters the data from a query string.</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 FilterAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, string query, bool treatSpacesAsAndOperator = true, bool matchNumbers = true, bool matchCase = false, bool matchWholeWord = false) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FilterAsync(Of T As Class)(dataCollection As IDataCollection(Of T), query As String, Optional treatSpacesAsAndOperator As Boolean = True, Optional matchNumbers As Boolean = True, Optional matchCase As Boolean = False, Optional matchWholeWord As Boolean = False) 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">query</span></td>
      <td><p>The query string to be filtered.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">treatSpacesAsAndOperator</span></td>
      <td><p>if set to <code>true</code> treat spaces as and operator.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">matchNumbers</span></td>
      <td><p>if set to <code>true</code> it will look into numeric fields.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">matchCase</span></td>
      <td><p>If set to <code>true</code> the case will be taken into account.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">matchWholeWord</span></td>
      <td><p>If set to <code>true</code> the whole word will have to be matched.</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_FilterAsync_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_FilterAsync__1_C1_DataCollection_IDataCollection___0__System_Func_System_Object_System_Boolean__" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync``1(C1.DataCollection.IDataCollection{``0},System.Func{System.Object,System.Boolean})">FilterAsync&lt;T&gt;(IDataCollection&lt;T&gt;, Func&lt;object, bool&gt;)</h4>
<div class="markdown level1 summary"><p>Filters the data from a query string.</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 FilterAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, Func&lt;object, bool&gt; predicate) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FilterAsync(Of T As Class)(dataCollection As IDataCollection(Of T), predicate As Func(Of Object, Boolean)) 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.func-2">Func</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>&gt;</td>
      <td><span class="parametername">predicate</span></td>
      <td><p>The predicate which will filter the collection.</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_FilterAsync_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_FilterAsync__1_C1_DataCollection_IDataCollection___0__C1_DataCollection_FilterExpression_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync``1(C1.DataCollection.IDataCollection{``0},C1.DataCollection.FilterExpression)">FilterAsync&lt;T&gt;(IDataCollection&lt;T&gt;, FilterExpression?)</h4>
<div class="markdown level1 summary"><p>Filters the data using specified filter expression.</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 FilterAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, FilterExpression? filterExpression) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FilterAsync(Of T As Class)(dataCollection As IDataCollection(Of T), filterExpression As FilterExpression) 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.FilterExpression.html">FilterExpression</a></td>
      <td><span class="parametername">filterExpression</span></td>
      <td><p>The filter expression applied to the data.</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_FilterAsync_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync*"></a>
<h4 id="C1_DataCollection_IDataCollectionEx_FilterAsync__1_C1_DataCollection_IDataCollection___0__C1_DataCollection_FilterExpression_System_Threading_CancellationToken_" data-uid="C1.DataCollection.IDataCollectionEx.FilterAsync``1(C1.DataCollection.IDataCollection{``0},C1.DataCollection.FilterExpression,System.Threading.CancellationToken)">FilterAsync&lt;T&gt;(IDataCollection&lt;T&gt;, FilterExpression?, CancellationToken)</h4>
<div class="markdown level1 summary"><p>Filters the data using specified filter expression.</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 FilterAsync&lt;T&gt;(this IDataCollection&lt;T&gt; dataCollection, FilterExpression? filterExpression, CancellationToken cancellationToken = default) where T : class?</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function FilterAsync(Of T As Class)(dataCollection As IDataCollection(Of T), filterExpression As FilterExpression, 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.FilterExpression.html">FilterExpression</a></td>
      <td><span class="parametername">filterExpression</span></td>
      <td><p>The filter expression applied to the data.</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>
