CollectionExtensionsDistinctByTSource, TKey Method
Returns only the elements whose keys are distinct.
Namespace: Gemstone.Collections.CollectionExtensionsAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
bool forwardSearch = true
)
<ExtensionAttribute>
Public Shared Function DistinctBy(Of TSource, TKey) (
source As IEnumerable(Of TSource),
keySelector As Func(Of TSource, TKey),
Optional forwardSearch As Boolean = true
) As IEnumerable(Of TSource)
public:
[ExtensionAttribute]
generic<typename TSource, typename TKey>
static IEnumerable<TSource>^ DistinctBy(
IEnumerable<TSource>^ source,
Func<TSource, TKey>^ keySelector,
bool forwardSearch = true
)
JavaScript does not support generic types or methods.
- 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.
- TSource
- The type of the source objects in the collection.
- TKey
- The type of the keys to be compared.
IEnumerableTSourceThe elements from
source whose keys are distinct.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).