CollectionExtensionsDistinctByTSource, TKey Method

Returns only the elements whose keys are distinct.

Definition

Namespace: Gemstone.Collections.CollectionExtensions
Assembly: 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
)

Parameters

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

IEnumerableTSource
The 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