Enumerable.Distinct: practical reference
Enumerable.Distinct: practical reference: Deferred enumeration returns the first occurrence of each value under the equality comparer and stores a set of keys already seen.
CKTIS / C#
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Enumerable.Distinct: practical reference: Deferred enumeration returns the first occurrence of each value under the equality comparer and stores a set of keys already seen.
Enumerable.DistinctBy: practical reference: Like Distinct, but uniqueness is computed from the key returned by keySelector; the result contract is unordered.
Enumerable.Empty: practical reference: Returns an empty typed sequence containing no elements. The implementation may share an instance, but code should rely only on IEnumerable<T>.
Enumerable.Except: practical reference: The deferred result returns unique elements of the first source absent from the second under the comparer. The second source is buffered in a set.
Enumerable.First: practical reference: Immediately returns the first element or first predicate match and ends enumeration.
Enumerable.FirstOrDefault: practical reference: Immediately returns the first element or predicate match; when none exists it returns default(T) or an explicitly supplied default value.
Enumerable.GroupBy divides a sequence into groups using a selected key. Each group exposes its key through Key, and its elements can be enumerated directly as a sequence.
Enumerable.GroupJoin: practical reference: For each outer element, creates a pair with the sequence of all inner elements having an equal key, including an empty sequence.
Enumerable.Intersect: practical reference: The deferred result returns unique elements of the first source also present in the second under the comparer.
Enumerable.Join: practical reference: Performs an inner join: calls resultSelector for every equal-key pair, while an element without a match is omitted.
Enumerable.Last: practical reference: Returns the last element or last predicate match; for a general IEnumerable<T> it normally reads the entire source.
Enumerable.LastOrDefault: practical reference: Returns the last element or predicate match; when absent it returns default(T) or an explicitly supplied default value.
Enumerable.Max: practical reference: Immediately enumerates and selects the greatest value or greatest selector result under the appropriate comparer.
Enumerable.Min: practical reference: Immediately enumerates and selects the smallest value or smallest selector result under the appropriate comparer.
Enumerable.OrderBy: practical reference: During enumeration, this deferred operation buffers the whole source and performs a stable ascending sort by key.
Enumerable.OrderByDescending: practical reference: Like OrderBy, but sorts the primary key descending. The sort remains stable.
Enumerable.Range: practical reference: Creates a deferred sequence of count consecutive Int32 values beginning at start.
Enumerable.Repeat: practical reference: Creates a deferred sequence containing the same value count times.
Enumerable.Select: practical reference: The deferred projection calls selector for each enumerated element and returns its result. The indexed overload passes a zero-based index.
Enumerable.SelectMany: practical reference: The deferred projection calls a collection selector and flattens the returned sequences into one result.
Enumerable.Single: practical reference: Requires exactly one element or match and enumerates far enough to detect a second.
Enumerable.SingleOrDefault: practical reference: Allows zero or one result; zero returns default(T), but two results remain an error.
Enumerable.Skip: practical reference: The deferred operation skips the first count elements and then returns the remainder.
Enumerable.SkipWhile: practical reference: Skips initial elements while the predicate is true; after the first false it returns every remaining element without skipping again.