{"id":21486187,"url":"https://github.com/grantwinney/CSharpDotNetFeatures","last_synced_at":"2025-07-15T14:32:51.160Z","repository":{"id":189390813,"uuid":"680557948","full_name":"grantwinney/CSharpDotNetExamples","owner":"grantwinney","description":"Discovering and learning about the various features of the C# programming language and .NET Framework.","archived":false,"fork":false,"pushed_at":"2024-09-17T02:45:34.000Z","size":73,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-17T06:19:40.746Z","etag":null,"topics":["c-sharp","csharp","csharp-1","csharp-11","csharp-12","csharp-4","csharp-6","csharp-7","csharp-9","dotnet","dotnet-1","dotnet-4","dotnet-46","dotnet-47","dotnet-6","dotnet-7","dotnet-8","tutorials"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grantwinney.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-19T16:25:37.000Z","updated_at":"2024-09-17T02:45:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"50b83d05-5822-4e1d-a827-8b68563ff105","html_url":"https://github.com/grantwinney/CSharpDotNetExamples","commit_stats":null,"previous_names":["grantwinney/csharpdotnetexamples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantwinney%2FCSharpDotNetExamples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantwinney%2FCSharpDotNetExamples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantwinney%2FCSharpDotNetExamples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantwinney%2FCSharpDotNetExamples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grantwinney","download_url":"https://codeload.github.com/grantwinney/CSharpDotNetExamples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226046021,"owners_count":17565096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","csharp","csharp-1","csharp-11","csharp-12","csharp-4","csharp-6","csharp-7","csharp-9","dotnet","dotnet-1","dotnet-4","dotnet-46","dotnet-47","dotnet-6","dotnet-7","dotnet-8","tutorials"],"created_at":"2024-11-23T13:19:49.090Z","updated_at":"2025-07-15T14:32:51.152Z","avatar_url":"https://github.com/grantwinney.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/user-attachments/assets/65ea9d4c-aa46-4ac3-bbb8-a3d9ad99ddc7\" width=\"200px\"\u003e\n\n# C# / .NET Features\n\nThe code here goes with [my blog posts](https://grantwinney.com) relate to specific versions of [C#](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history) and [.NET](https://learn.microsoft.com/en-us/dotnet/core/whats-new/), which are [very closely related](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/relationships-between-language-and-library) and usually updated at the same time _(see [here](https://github.com/dotnet/csharplang/blob/main/Language-Version-History.md) and [here](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Versions))_. I sometimes upload code to separate repos (like for [WinForms](https://github.com/grantwinney/Surviving-WinForms) and [misc topics](https://github.com/grantwinney/BlogCodeSamples)), or to [Gist](https://gist.github.com/grantwinney) or [JsFiddle](https://jsfiddle.net/user/grantwinney/fiddles/) for shorter snippets.\n\n- [What's new in C# | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history)\n- [What's new in .NET | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/core/whats-new)\n- [The relationship between C# language features and library types | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/relationships-between-language-and-library)\n- [Features Added in C# Language Versions · dotnet/csharplang](https://github.com/dotnet/csharplang/blob/main/Language-Version-History.md)\n- [C# programming language versions - Wikipedia](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Versions)\n- [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core)\n\nThe list below has links to each blog post and the relevant code, separated by version of language/framework. Links with a `†` next to them are in a separate repo, most likely [Surviving WinForms](https://github.com/grantwinney/Surviving-WinForms), which applies concepts specifically to the WinForms framework.\n\n## C# 13 / .NET 9\n\n- Using CountBy and AggregateBy in LINQ ([blog post](https://grantwinney.com/using-linq-countby-and-aggregateby-in-csharp), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2013/CountByAggregateBy))\n\n## C# 12 / .NET 8\n\n- Primary Constructors in Classes and Structs ([blog post](https://grantwinney.com/using-primary-constructors-with-classes-and-structs-in-csharp), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2012/PrimaryConstructors))\n- Time Abstraction\n  - Part 1 - How to use TimeProvider and FakeTimeProvider ([blog post](https://grantwinney.com/how-to-use-timeprovider-and-faketimeprovider), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2012/TimeAbstraction))\n  - Part 2 - How to use TimeProvider and FakeTimeProvider with timers ([blog post](https://grantwinney.com/how-to-use-timeprovider-and-faketimeprovider-to-test-timers), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2012/TimeAbstraction_Timers))\n\n## C# 11 / .NET 7\n\n- Generic Math Support series ([source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2011/GenericMathSupport))\n  - Part 1 - What's a static abstract interface method? ([blog post](https://grantwinney.com/whats-a-static-abstract-interface-method-in-c))\n  - Part 2 - How do I overload arithmetic, equality, and comparison operators? ([blog post](https://grantwinney.com/how-do-i-overload-operators-in-csharp))\n  - Part 3 - What is Generic Math Support? ([blog post](https://grantwinney.com/whats-generic-math-support-in-csharp))\n- Generic Attributes ([blog post](https://grantwinney.com/what-are-generic-attributes), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2011/GenericAttributes))\n- List Patterns ([blog post](https://grantwinney.com/whats-a-list-pattern-in-csharp), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2011/ListPatternMatching))\n- Raw String Literals ([blog post](https://grantwinney.com/using-raw-string-literals-in-csharp), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2011/RawStringLiterals))\n\n## C# 10 / .NET 6\n\n- MinBy and MaxBy in LINQ ([blog post](https://grantwinney.com/using-minby-and-maxby-in-csharp), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2010/MaxByMinBy))\n- Set-based LINQ - ExceptBy, IntersectBy, UnionBy, DistinctBy ([blog post](https://grantwinney.com/set-based-linq-exceptby-intersectby-unionby-distinctby), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2010/SetBasedLinqMethods))\n\n## C# 9 / .NET 5\n\n- Records, Classes and Equality ([blog post](https://grantwinney.com/records-classes-and-equality-in-csharp), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2009/RecordModifier))\n- Switch/Case Pattern Matching (vs if/else) ([blog post](https://grantwinney.com/if-else-vs-switch-case-pattern-matching), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2009/SwitchPatternMatchingVsIfElse))\n\n## C# 8 / .NET Core 3.x\n\n- _None_\n\n## C# 7 / .NET 4.7\n\n- Local Functions (aka nested methods) ([blog post](https://grantwinney.com/local-functions-in-csharp-aka-nested-methods), [source code](https://github.com/grantwinney/SurvivingWinForms/tree/master/ClarityConciseness/LocalFunctions)) †\n- Tuples and Deconstruction ([blog post](https://grantwinney.com/using-tuple-and-deconstruction-to-return-multiple-values), [source code](https://github.com/grantwinney/SurvivingWinForms/tree/master/ClarityConciseness/TupleDeconstruction)) †\n- Adding **deconstructors** to your own (and built-in) types in C# ([blog post](https://grantwinney.com/adding-deconstructors-in-csharp-is-it-worth-it), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2007/DeconstructingUserDefinedTypes))\n\n## C# 6 / .NET 4.6\n\n- Null-conditional and Null-coalescing operators ([blog post](https://grantwinney.com/null-conditional-and-null-coalescing-operators), [source code](https://github.com/grantwinney/SurvivingWinForms/tree/master/ClarityConciseness/NullHandlingOperators)) †\n- Nameof ([blog post](https://grantwinney.com/using-nameof-to-avoid-magic-strings), [source code](https://github.com/grantwinney/Surviving-WinForms/tree/master/AntiPatterns/MagicStrings/NameOfVersusMagicStrings)) †\n- String Interpolation ([blog post](https://grantwinney.com/using-string-interpolation-to-craft-readable-strings), [source code](https://github.com/grantwinney/SurvivingWinForms/tree/master/ClarityConciseness/StringInterpolation)) †\n\n## C# 5 / .NET 4.5\n\n- _None_\n\n## C# 4 / .NET 4\n\n- Named Arguments ([blog post](https://grantwinney.com/named-arguments-in-c-pass-what-you-want-and-forget-the-rest), [source code](https://github.com/grantwinney/SurvivingWinForms/tree/master/ClarityConciseness/NamedArguments)) †\n\n## C# 3 / .NET 3\n\n- _None_\n\n## C# 2 / .NET 2\n\n- _None_\n\n## C# 1 / .NET 1\n\n- Attributes ([blog post](https://grantwinney.com/what-are-attributes-and-why-do-we-need-them/), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/C%23%2001/Attributes))\n- Exceptions (throw vs throw ex) ([blog post](https://grantwinney.com/does-rethrowing-an-exception-in-csharp-still-reset-the-stack-trace/))\n\n## General Concepts\n\n* Implicit vs Explicit Conversion ([blog post](https://grantwinney.com/csharp-implicit-vs-explicit-conversion/), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/GeneralConcepts/ImplicitExplicitOperators))\n* Singleton vs Scoped vs Transient ([blog post](https://grantwinney.com/difference-between-singleton-scoped-transient), [source code](https://github.com/grantwinney/CSharpDotNetFeatures/tree/master/GeneralConcepts/SingletonVsTransientDI))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantwinney%2FCSharpDotNetFeatures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrantwinney%2FCSharpDotNetFeatures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantwinney%2FCSharpDotNetFeatures/lists"}