property pattern
A pattern in braces that tests an object's properties, as in kettle is { Price: > 20m }.
In more detail
It can test several properties at once and nest further patterns inside. is { } product matches any non-null value and names it, a shape the course uses to turn a lookup into Ok or NotFound.
Related terms
- pattern matching — Testing a value against a shape, such as a type, a range or the values of its properties, and optionally extracting parts of it in the same step.
- relational pattern — A pattern that compares with a constant using <, >, <= or >=, such as > 20m.
Taught in
- Records, Pattern Matching, and Modern C# — Modern .NET Core, C# & Enterprise Microservices
- Building Routes with Controllers — Modern .NET Core, C# & Enterprise Microservices
- Building Routes with Minimal APIs — Modern .NET Core, C# & Enterprise Microservices