- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.1k
Closed
Labels
dotnet-csharp/svchelp wantedGood for community contributors to help [up-for-grabs]Good for community contributors to help [up-for-grabs]
Milestone
Description
In the Index initializers section, the initial text about collection initializers seems to imply that there was no way to initialize a Dictionary<,> prior to the new C# 6.0 syntax. This is incorrect. The following code is semantically equivalent to the index initializer example in the document.
private Dictionary<int, string> webErrors = new Dictionary<int, string>
{
    { 404, "Page not Found" },
    { 302, "Page moved, but left a forwarding address." },
    { 500, "The web server can't come out to play today." }
};Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 36fef60d-04e9-dc86-2e3f-134c10ea37bb
- Version Independent ID: 09b5aa7a-1b43-8bf9-9786-f10f457488dd
- Content: What's New in C# 6 - C# Guide
- Content Source: docs/csharp/whats-new/csharp-6.md
- Service: unspecified
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn
Metadata
Metadata
Assignees
Labels
dotnet-csharp/svchelp wantedGood for community contributors to help [up-for-grabs]Good for community contributors to help [up-for-grabs]