Using new .Chunk and .DistinctBy Linq Extensions

This commit is contained in:
Kwoth
2021-12-24 02:10:21 +01:00
parent 594a3b1f97
commit 26ee6ce4d3
6 changed files with 14 additions and 45 deletions

View File

@@ -20,10 +20,6 @@ public static class IEnumerableExtensions
return string.Join(separator, data.Select(func));
}
public static IEnumerable<T> Distinct<T, U>(this IEnumerable<T> data, Func<T, U> getKey) =>
data.GroupBy(x => getKey(x))
.Select(x => x.First());
/// <summary>
/// Randomize element order by performing the Fisher-Yates shuffle