What happens under the hood when using array initialization syntax to initialize a Dictionary instan
- by Carlos Loth
Does anyone know what C# compiler does under the hood with the following code?
dict = new Dictionary<int, string>()
{
{ 1, "value1" },
{ 2, "value2" }
}
It is not clear to if it creates the KeyValuePair instances and call the Add method, or do something more optimized. Does anyone of you know it?