This is a repo that shows C# code examples of different features. These features are orgnized by versions of C#. From this, you could get more familiar with C# version history. And you can know more about how this language envolved in the past years.
- Anonymous types
- Auto implemented properties
- Extension Methods
- Implicitly typed local variables
- Lambda
- LINQ
- Object and collection initializers
- Partial methods
- Expression Trees (To do)
- Dynamic types
- Generic covariant and contra variant
- Named arguments
- Optional arguments
- Embedded interop types (Todo)
- Static imports
- Exception filters
- Auto-property initializers
- Expression bodied members
- Null propagator
- String interpolation
- nameof operator
- Index initializers
- Out variables
- Tuples and Discards
- Deconstruct
- Pattern matching
- Local functions
- More expression bodied members
- Ref locals and resturns
- The
throw
expression
- Default interface methods
- Enhanced pattern matching(Todo)
- Using Declarations
- Static local functions
- Asynchronous streams
- Indices and ranges
- Null-coalescing assignment
- DisposeAsync (Todo)
- Top level statements
- Record types
- Init only setters
- Pattern matching enhancements
- Enhanced
new
expressions - Support for code generators (Todo)