c# - How do you use collection initializers to create a new dictionary? -
if can in list
list<int> = new list<int>() { 2, 4, 6, 8, 10 }; how can same thing in dictionary?
dictionary<int, bool> b = new dictionary<int, bool>() { ?, ?, ? };
dictionary<int, bool> b = new dictionary<int, bool>() { {1, true},{2, false},{3, true} };
Comments
Post a Comment