-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Collections_EnumerableExtensions_DistinctBy__2
Andrew Koryavchenko edited this page Jun 17, 2018
·
8 revisions
Returns a sequence with distinct elements from the input sequence based on the specified key.
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector
)
VB
<ExtensionAttribute>
Public Shared Function DistinctBy(Of TSource, TKey) (
source As IEnumerable(Of TSource),
keySelector As Func(Of TSource, TKey)
) As IEnumerable(Of TSource)
F#
[<ExtensionAttribute>]
static member DistinctBy :
source : IEnumerable<'TSource> *
keySelector : Func<'TSource, 'TKey> -> IEnumerable<'TSource>
- source
- Type: System.Collections.Generic.IEnumerable(TSource)
The sequence to return distinct elements from. - keySelector
- Type: System.Func(TSource, TKey)
A function to extract the key for each element.
- TSource
- [Missing documentation for "M:CodeJam.Collections.EnumerableExtensions.DistinctBy
2(System.Collections.Generic.IEnumerable{
0},System.Func{0,
1})"] - TKey
- [Missing documentation for "M:CodeJam.Collections.EnumerableExtensions.DistinctBy
2(System.Collections.Generic.IEnumerable{
0},System.Func{0,
1})"]
Type: IEnumerable(TSource)
An IEnumerable(T) that contains distinct elements from the source sequence.
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(TSource). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
EnumerableExtensions Class
DistinctBy Overload
CodeJam.Collections Namespace