The samples in this repo go along with my blog posts that relate to specific versions of C# and versions of .NET, which are very closely related and usually updated at the same time (as seen here and there). I occasionally host shorter snippets on Gist or JsFiddle and embed those into posts too.
The list below has links to each blog post, as well as a direct link to the relevant code for each post, separated by version of language/framework. Links with a †
next to them are in a separate repo, most likely Surviving WinForms, which introduces concepts while showing how they could be applied to WinForms.
- None
- Generic Math Support series (source code)
- Generic Attributes (blog post, source code)
- List Patterns (blog post, source code)
- None
- None
- None
- Local Functions (aka nested methods) (blog post, source code) †
- Tuples and Deconstruction (blog post, source code) †
- Adding deconstructors to your own (and built-in) types in C# (blog post, source code)
- Null-conditional and Null-coalescing operators (blog post, source code) †
- Nameof (blog post, source code) †
- String Interpolation (blog post, source code) †
- None
- Named Arguments (blog post, source code) †
- None
- None
- Attributes (blog post, source code)
- Exceptions (throw vs throw ex) (blog post)