You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modernise snippets showing use of generics in C# (#43678)
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
0 commit comments