# GrapeCity.ActiveReports.Rendering.Tools.EnumerableExtension.ForceInBackground

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Rendering_Tools_EnumerableExtension_ForceInBackground_" data-uid="GrapeCity.ActiveReports.Rendering.Tools.EnumerableExtension.ForceInBackground*">ForceInBackground Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Rendering_Tools_EnumerableExtension_ForceInBackground_" data-uid="GrapeCity.ActiveReports.Rendering.Tools.EnumerableExtension.ForceInBackground*"></a>
<h4 id="GrapeCity_ActiveReports_Rendering_Tools_EnumerableExtension_ForceInBackground__1_System_Collections_Generic_IEnumerable___0__System_Threading_CancellationToken_" data-uid="GrapeCity.ActiveReports.Rendering.Tools.EnumerableExtension.ForceInBackground``1(System.Collections.Generic.IEnumerable{``0},System.Threading.CancellationToken)">ForceInBackground&lt;T&gt;(IEnumerable&lt;T&gt;, CancellationToken)</h4>
<div class="markdown level1 summary"><p>Forces evaluation of the given <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> in a separate thread and returns a new <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> to be enumerated in the current thread.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; ForceInBackground&lt;T&gt;(this IEnumerable&lt;T&gt; src, CancellationToken cancellationToken)</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="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
      <td><span class="parametername">src</span></td>
      <td><p>The source sequence.</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>A token to cancel enumeration.</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.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
      <td><p>A sequence that is evaluated in a background thread.</p>
</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><p>The type of elements in the sequence.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_Rendering_Tools_EnumerableExtension_ForceInBackground_" data-uid="GrapeCity.ActiveReports.Rendering.Tools.EnumerableExtension.ForceInBackground*"></a>
<h4 id="GrapeCity_ActiveReports_Rendering_Tools_EnumerableExtension_ForceInBackground__1_System_Collections_Generic_IEnumerable___0__System_Threading_CancellationToken_System_Int32_" data-uid="GrapeCity.ActiveReports.Rendering.Tools.EnumerableExtension.ForceInBackground``1(System.Collections.Generic.IEnumerable{``0},System.Threading.CancellationToken,System.Int32)">ForceInBackground&lt;T&gt;(IEnumerable&lt;T&gt;, CancellationToken, int)</h4>
<div class="markdown level1 summary"><p>Forces evaluation of the given <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> in a separate thread and returns a new <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable&lt;T&gt;</a> to be enumerated in the current thread.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static IEnumerable&lt;T&gt; ForceInBackground&lt;T&gt;(this IEnumerable&lt;T&gt; src, CancellationToken cancellationToken, int maxBufferSize)</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="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
      <td><span class="parametername">src</span></td>
      <td><p>The source sequence.</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>A token to cancel enumeration.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">maxBufferSize</span></td>
      <td><p>The maximum buffer size. If zero, the size is unlimited.</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.collections.generic.ienumerable-1">IEnumerable</a>&lt;T&gt;</td>
      <td><p>A sequence that is evaluated in a background thread.</p>
</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><p>The type of elements in the sequence.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
