Initial split of the modules
This commit is contained in:
13
NadekoBot.Core/_Extensions/IEnumerableExtensions.cs
Normal file
13
NadekoBot.Core/_Extensions/IEnumerableExtensions.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace NadekoBot.Extensions
|
||||
{
|
||||
public static class IEnumerableExtensions
|
||||
{
|
||||
public static IEnumerable<T> Distinct<T, U>(this IEnumerable<T> data, Func<T, U> getKey) =>
|
||||
data.GroupBy(x => getKey(x))
|
||||
.Select(x => x.First());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user