-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernise snippets showing use of generics in C#
Use some newer language features to increase the signal/noise ratio in code samples used to describe generics in C#. - Make code shorter through auto properties. - Narrow scope of <Snippet> areas to remove boilerplate. - Use target-typed new. - Remove redundant constructor. Note we could go further with the language features here (such as collection initializers) but as this seems like a very fundamental level article I thought it best to use more explicit forms. These snippets are used in https://review.learn.microsoft.com/en-us/dotnet/csharp/fundamentals/types/generics?branch=main
- Loading branch information
1 parent
e2d83bb
commit ce358ef
Showing
1 changed file
with
32 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters