title: .net6 & MoreLinq : Call is ambiguous between System.Linq.Enumerable.DistinctBy and MoreLinq.MoreEnumerable.DistinctBy
body: <p>Recently I upgraded one of my projects to use <code>.NET 6</code>. Earlier I was using <a href="https://github.com/morelinq/MoreLINQ" rel="noreferrer">MoreLinq</a> library to use <a href="https://morelinq.github.io/2.2/ref/api/html/M_MoreLinq_MoreEnumerable_DistinctBy__2.htm" rel="noreferrer"><code>DistinctBy()</code></a> to apply it on the specific property.</p>
  <p>Now as I upgraded TargetFramework to <code>.NET 6</code>, this change come up with inbuilt support to <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.distinctby?view=net-6.0" rel="noreferrer"><code>DistinctBy()</code></a>.</p>
  <p>Now the compiler is confused about which <code>DistinctBy()</code> needs to select, I can't rely on <code>System.Linq</code>, because the removal of <code>using MoreLinq</code> will cause multiple other errors.</p>
  <p>I know if we face ambiguity between the same methods then we can use <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive#using-alias" rel="noreferrer"><code>using alias</code></a>, but I am not sure how to use <code>using alias</code> for Linq extension methods.</p>
  <p><strong>Here is the error:</strong></p>
  <p><a href="https://i.stack.imgur.com/tfqYB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tfqYB.png" alt="enter image description here" /></a></p>
  <p>I am able to replicate the same issue in the below fiddle</p>
  <p><a href="https://dotnetfiddle.net/K3GESr" rel="noreferrer">Try online</a></p>