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.
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.