logical pattern
The C# pattern keywords and, or and not, which combine or negate other patterns.
In more detail
They let one pattern express a range, a set of alternatives or an exclusion. "shipped" or "in transit" lets two constants share one switch arm, and is not null reads as plain English.
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