Enumerable.ToDictionary: practical reference
Enumerable.ToDictionary: practical reference: Immediately enumerates and builds a Dictionary<TKey,TValue> from selected keys and optional selected values.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Enumerable.ToDictionary: practical reference: Immediately enumerates and builds a Dictionary<TKey,TValue> from selected keys and optional selected values.
Enumerable.ToList: practical reference: Immediately enumerates and copies elements into a new mutable List<T>.
Enumerable.ToLookup: practical reference: Immediately builds a read-only index where one key can have multiple values.
Enumerable.Union: practical reference: The deferred result yields unique elements of the first source and then new unique elements of the second under the comparer.
Enumerable.Where: practical reference: The deferred filter returns original elements for which the predicate is true; the indexed overload passes the source index.
Enumerable.Zip: practical reference: The deferred operation combines elements at equal positions and stops when the shortest source is exhausted.
Environment.Exit(int exitCode) terminates the entire process and passes an exit code to the operating system. It is not an ordinary method return: it also stops other threads and skips finally blocks.
System.EventArgs is the base class used in the standard .NET event pattern. A custom derived class carries data to handlers, while EventArgs.Empty is used when raising events without additional data.
System.EventHandler<TEventArgs> defines a delegate for handling events that carry data of a specified type. It connects a publisher with subscribers without requiring a custom delegate type.
ExpandoObject in System.Dynamic lets you add and remove members at run time. It supports access through dynamic and through the IDictionary<string, object?> dictionary interface.
FormattableString.Invariant formats the arguments of an interpolated string using the invariant culture and returns a string. It produces numeric text independent of the current culture while retaining the supplied format specifiers.
HashCode.Combine produces an int hash code from one to eight values. It is useful in GetHashCode for types with field-based equality, but its result is neither a persistent identifier nor proof of equality.
ICustomFormatter.Format lets a format provider control a value's text representation without changing its type. It works with IFormatProvider and methods such as string.Format; an implementation should also handle ordinary formats and null.
System.IFormatProvider supplies information used during formatting and parsing. Its single method, GetFormat, returns an object of the requested type or null when the provider does not support that type.
System.IFormattable defines conversion of a value to text using a format string and a provider of formatting information. It lets custom types participate in composite formatting, such as string.Format, rather than relying only on parameterless ToString().
IMemoryOwner<T> expresses responsibility for a buffer's lifetime. Its Memory property exposes the contents as Memory<T>, while the inherited Dispose ends the owner's use of the resource.
System.IndexOutOfRangeException signals, among other cases, an attempt to read or write an array element using an invalid index. Usually, fix the index calculation or loop bounds rather than using the exception for normal control flow.
System.Index describes a position measured from the start or end of a sequence, while System.Range describes a start-inclusive, end-exclusive interval. The ^ and .. operators simplify element access and slicing; cost and data sharing depend on the sequence type.
Int32.Parse converts numeric text to int. Learn its default format rules, how culture affects parsing, and which exceptions invalid input produces.
INumber<T> lets you write one generic method for different numeric types. Its constraint exposes operators and the inherited T.Zero and T.CreateChecked members, allowing you to initialize an accumulator and convert input values.
JsonException from System.Text.Json signals invalid JSON, an exceeded nesting limit, or a value incompatible with the target type. It also exposes diagnostic information that helps locate the problem in the input.
JsonTokenType is an enumeration in System.Text.Json describing a token recognized by Utf8JsonReader. It distinguishes object and array boundaries, property names, and values. None means the state before reading, not the JSON value null.
System.Collections.Generic.KeyNotFoundException signals an attempt to retrieve an element using a key that does not exist. Learn how Dictionary<TKey,TValue> indexer reads differ from writes and when to use TryGetValue for an expected missing key.
KeyValuePair<TKey,TValue> holds one key and one value of specified types. Its Key and Value properties are read-only; you encounter this type, for example, when iterating over Dictionary<TKey,TValue>.