You were so close. It should be: Dictionary<string, int> d = new() { { "a", 1 } };
Dictionary<string, int> d = new() { { "a", 1 } };