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 dictionary initializers #2

Open
mikedamay opened this issue Jun 16, 2020 · 0 comments
Open

Add dictionary initializers #2

mikedamay opened this issue Jun 16, 2020 · 0 comments

Comments

@mikedamay
Copy link
Contributor

There are 2 ways to initialize a dictionary in C#:

  • var dict = new Dictionary<int, String>{{1, "one"}, {2, "two"}};
  • var dict = new Dictionary<int, String>{[1] = "one", [2] = "two"};

There is no difference except the syntax so they should be normalized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant