Category: Syntax
Using C#9 record and init property in your .NET Framework 4.x, .NET Standard and .NET Core projects
C#9 record and C#9 init property are really nice addition to the language. As explained in C#9 records: immutable classes, both are syntactic sugar that don’t require any change at...
C# Index and Range Operators Explained
C#8 added the index ^ and range .. operators. In this post I am attempting to demystify both in the most comprehensive way. The index operator ^ Let’s start with...
C#9 records: immutable classes
Record is a long time awaited feature now proposed by C# 9. With record we have a concise syntax to define immutable types this way: [crayon-6518d0a2ddbb5440845683/] Isn’t it beautiful? In...
New C#9 keywords ‘and’ ‘or’ ‘not’
HoweverThe C#9 language introduces new controversial keywords: and keyword: Conjunctive patterns. Require both patterns to match or keyword: Disjunctive patterns. Require either pattern to match not keyword: Negative patterns. Require...