EnumerableExtensions.

Distinct<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>) Method

Summary

Select a distinct instance of an object from a collection of objects.

Syntax

public static IEnumerable<TSource> Distinct<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> getKey)

Attributes

Type Description
IteratorStateMachineAttribute

Type Parameters

Name Description
TSource The type of the object to select.
TKey The type of the key to search for.

Parameters

Name Type Description
source IEnumerable<TSource> The collection of objects to select from.
getKey Func<TSource, TKey> The key that is being searched for.

Return Value

Type Description
IEnumerable<TSource>