.NET developer: Blazor

Sefism.

A to Z

Glossary

Every concept in this sheet, plus the smaller terms it uses. Select a concept to open its card.

C
Choosing a collection
List<T> keeps order and allows duplicates.
Collection expressions
Since C# 12, [a, b, c] creates an array, List, Span or other collection, chosen by the target type.
D
Deferred execution
A LINQ query does nothing when you write it.
E
Exceptions, using and finally
Code throws an exception for a situation it cannot handle; the nearest matching catch up the call stack handles it.
Extension methods and extension members
An extension method adds a method to a type you do not own, through a static class and a this parameter.
F
First, Single and the OrDefault versions
First takes the first match and throws if there is none.
G
Generics and constraints
Generics let a class or method work with any type while staying type-safe: List<Order> only holds orders.
GroupBy and aggregates
GroupBy buckets items by a key; Sum, Count, Average, Min and Max reduce a sequence or each group to one value.
I
IEnumerable vs IQueryable
IEnumerable runs LINQ in memory with C# delegates.
N
Nullable reference types
With <Nullable>enable</Nullable> (on in every new template) string means never null and string? means may be null.
P
Pattern matching and switch expressions
Patterns test the shape of a value: its type, a constant, a range or its properties.
Primary constructors
Since C# 12, a class can declare constructor parameters next to its name.
R
Records
A record is a type built for data: the compiler writes value equality, a readable ToString and, with positional syntax, an immutable constructor and properties.
V
Value types and reference types
A struct (int, decimal, DateTime, your own structs) is copied when you assign or pass it.
W
Where, Select and OrderBy
LINQ methods chain together: Where filters, Select shapes each item into something new, OrderBy and ThenBy sort, Take and Skip page.
11 · Glossary, A to Z11 / 11