# C1.Util.DX.DXUtil.Distinct

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DXUtil_Distinct_" data-uid="C1.Util.DX.DXUtil.Distinct*">Distinct Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DXUtil_Distinct_" data-uid="C1.Util.DX.DXUtil.Distinct*"></a>
<h4 id="C1_Util_DX_DXUtil_Distinct__1_System_Collections_Generic_IEnumerable___0__System_Collections_Generic_IEqualityComparer___0__" data-uid="C1.Util.DX.DXUtil.Distinct``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEqualityComparer{``0})">Distinct&lt;TSource&gt;(IEnumerable&lt;TSource&gt;, IEqualityComparer&lt;TSource&gt;)</h4>
<div class="markdown level1 summary"><p>Selects distinct elements from an enumeration.</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;TSource&gt; Distinct&lt;TSource&gt;(IEnumerable&lt;TSource&gt; source, IEqualityComparer&lt;TSource&gt; comparer = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Distinct(Of TSource)(source As IEnumerable(Of TSource), Optional comparer As IEqualityComparer(Of TSource) = Nothing) As IEnumerable(Of TSource)</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;TSource&gt;</td>
      <td><span class="parametername">source</span></td>
      <td><p>The source.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1">IEqualityComparer</a>&lt;TSource&gt;</td>
      <td><span class="parametername">comparer</span></td>
      <td><p>The comparer.</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;TSource&gt;</td>
      <td><p>A enumeration of selected values</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">TSource</span></td>
      <td><p>The type of the T source.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
