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#

Int32.Parse — converting text to int

Int32.Parse converts numeric text to int. Learn its default format rules, how culture affects parsing, and which exceptions invalid input produces.

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

INumber<T>: generic numeric calculations

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.

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

JsonException — JSON data errors

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.

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

JsonTokenType — JSON token kind

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.

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

KeyNotFoundException — a missing collection key

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.

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

KeyValuePair<TKey,TValue> — a key-value pair

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

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

MidpointRounding — choosing a rounding rule

MidpointRounding specifies a rounding rule. ToEven and AwayFromZero both choose the nearest result, but resolve values exactly halfway between two possible results differently.

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

Monitor — locking and waiting for a condition

System.Threading.Monitor combines mutual exclusion with waiting for shared state to change. Enter and Exit manage the lock, TryEnter can bound acquisition waiting, and Wait, Pulse, and PulseAll coordinate threads.

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

The non-generic IEnumerable interface

System.Collections.IEnumerable exposes iteration without specifying an element type through a generic parameter. Its GetEnumerator() method returns IEnumerator, and foreach reads elements through this contract.

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

IEnumerator — the non-generic enumerator interface

System.Collections.IEnumerator describes a cursor for sequentially reading elements. It exposes MoveNext(), an object-valued Current, and Reset(); it is not a collection and does not guarantee IDisposable support.

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

NotNullWhenAttribute — a conditional non-null guarantee

NotNullWhenAttribute describes the relationship between a method's bool result and an argument's null-state. It lets nullable analysis recognize the safe branch after a checking method or a Try*-style method, without using the ! operator.

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

NullReferenceException — using a null reference

System.NullReferenceException signals an attempt to dereference null, such as reading a property on an object that does not exist. Learn the cause, the role of nullable analysis, and the difference between !, ?., and ??.

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

NumberFormatInfo — numeric formatting rules

NumberFormatInfo supplies rules for formatting and parsing numbers, including separators and currency symbols. Learn its core methods, the distinction between current and invariant settings, and how to create a custom configuration safely.

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

OperationCanceledException — signaling operation cancellation

OperationCanceledException signals that an operation was canceled. Learn how it works with CancellationToken, what ThrowIfCancellationRequested() does, and how requesting cancellation differs from acknowledging it.

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

BindingFlags — filtering members with reflection

BindingFlags controls which type members reflection searches for. Combine visibility and member-kind flags with |, and use DeclaredOnly to exclude inherited members.

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

RegionInfo — region and ISO currency code

RegionInfo in System.Globalization exposes information about a country or region. Its RegionInfo.ISOCurrencySymbol property returns a three-letter ISO 4217 currency code, such as USD, rather than a currency sign such as $.

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

String.Join — joining elements with a separator

String.Join combines elements into one string, inserting a separator between them. Null values are not skipped.

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

System.Action — a delegate with no return value

System.Action represents a parameterless operation that returns void. The Action<T> variant accepts one argument. Both types let you store and pass behavior, such as a method that prints a message, without declaring a custom delegate type.

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

System.Activator: practical reference

System.Activator: practical reference: Activator.CreateInstance creates an instance of a type selected at run time through an available constructor.

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

System.ArgumentException: practical reference

System.ArgumentException: practical reference: ArgumentException denotes a non-null argument that violates the contract and can retain its ParamName.

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

System.ArgumentNullException: practical reference

System.ArgumentNullException: practical reference: ArgumentNullException specializes the error for a required argument that is null; ThrowIfNull retains the expression name.

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

System.Attribute: practical reference

System.Attribute: practical reference: Attribute is the base for metadata attached to types and members and read through reflection.

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

System.Buffers.ArrayPool: practical reference

System.Buffers.ArrayPool: practical reference: ArrayPool<T> rents an array whose length is at least the requested size and requires Return.

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

System.Buffers.IBufferWriter: practical reference

System.Buffers.IBufferWriter: practical reference: IBufferWriter<T> exposes writable storage through GetSpan or GetMemory, while Advance commits the exact number of elements written.

Basic · .NET API; verified on .NET 10.0.14