Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples of a spread element to the "Collection initializers" article #44045

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BartoszKlonowski
Copy link
Contributor

@BartoszKlonowski BartoszKlonowski commented Dec 20, 2024

This pull request closes #44032

It presents the spread element examples by:

  • Creating a list out of other lists
  • Creating a list out of other lists and single element in between, to show that those syntax can be mixed
  • Using the spread element syntax to create a full list of all cats that is displayed at the very end of the collection full example

Each example is described with brief intro as other examples in that section.


Internal previews

📄 File 🔗 Preview link
docs/csharp/programming-guide/classes-and-structs/object-and-collection-initializers.md Object and Collection Initializers (C# Programming Guide)

@BartoszKlonowski BartoszKlonowski requested review from BillWagner and a team as code owners December 20, 2024 15:42
@dotnetrepoman dotnetrepoman bot added this to the December 2024 milestone Dec 20, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates PR is created by someone from the .NET community. dotnet-csharp/svc fundamentals/subsvc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an example with a spread element (..) in a collection expression
1 participant