Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

Knowledge base — C#

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 443

C#

Enumerable.Sum: practical reference

Enumerable.Sum: practical reference: Immediately enumerates and adds values in the overload-specific type; nullable overloads ignore null.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Take: practical reference

Enumerable.Take: practical reference: The deferred operation returns at most the first count elements and ends enumeration when the limit is reached.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.TakeWhile: practical reference

Enumerable.TakeWhile: practical reference: Returns the initial segment while the predicate is true and stops at the first false.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.ThenBy: practical reference

Enumerable.ThenBy: practical reference: Adds a stable ascending secondary key to an existing IOrderedEnumerable<T>.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.ToArray: practical reference

Enumerable.ToArray: practical reference: Immediately enumerates and copies elements into a new fixed-length array.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.ToDictionary: practical reference

Enumerable.ToDictionary: practical reference: Immediately enumerates and builds a Dictionary<TKey,TValue> from selected keys and optional selected values.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.ToList: practical reference

Enumerable.ToList: practical reference: Immediately enumerates and copies elements into a new mutable List<T>.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.ToLookup: practical reference

Enumerable.ToLookup: practical reference: Immediately builds a read-only index where one key can have multiple values.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Union: practical reference

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.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Where: practical reference

Enumerable.Where: practical reference: The deferred filter returns original elements for which the predicate is true; the indexed overload passes the source index.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Zip: practical reference

Enumerable.Zip: practical reference: The deferred operation combines elements at equal positions and stops when the shortest source is exhausted.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Environment.Exit — terminating a process

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.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

System.EventArgs — event data

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.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

EventHandler<TEventArgs> — events with typed 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.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

ExpandoObject — an object with a changeable set of members

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.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

FormattableString.Invariant — invariant-culture interpolation

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.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

HashCode.Combine — combining values into a hash code

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.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

ICustomFormatter.Format — custom value formatting

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.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

IFormatProvider — supplying formatting information

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.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

IFormattable — formatting values with a format provider

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().

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

IMemoryOwner<T> — ownership of a memory buffer

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.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

IndexOutOfRangeException — index outside bounds

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.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

System.Index and System.Range — indices and slices

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.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification