|
CollectionExtensionsDistinctByTSource, TKey Method
|
Returns only the elements whose keys are distinct.
Namespace: GSF.CollectionsAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax public static IEnumerable<TSource> DistinctBy<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
bool forwardSearch = true
)
JavaScript does not support generic types or methods.
View SourceParameters
- source IEnumerableTSource
- The collection of source objects.
- keySelector FuncTSource, TKey
- The function used to access the keys of the source objects.
- forwardSearch Boolean (Optional)
- true to search forward in source; otherwise false to search backwards.
Type Parameters
- TSource
- The type of the source objects in the collection.
- TKey
- The type of the keys to be compared.
Return Value
IEnumerableTSourceThe elements from
source whose keys are distinct.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTSource. 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).
See Also