Table of Contents

Marble diagram

The Distinct operator ensures that only unique elements are included in the result sequence. Uniqueness is specified by the default EqualityComparer<T> for the type of the elements in the source sequence. If multiple non-unique elements are present in the source sequence, only the first element will be included in the result sequence.

Examples

Use Distinct to extract unique elements from a sequence.

Distinct Example

Use DistinctUntilChanged to extract elements that are distinct from the previous element.