Dictionary<int, string> dictNew = new Dictionary<int,string>()
{
{1, "true"},
{2, "false"}
}
var dictionary = new Dictionary<string, string>
{
{ "LAX", "Los Angeles International Airport" },
{ "MEL", "Melbourne Tullamarine Airport" }
};
//C# 6 introduces a new index-like syntax to initialize dictionaries:
var dictionary = new Dictionary<string, string>
{
["LAX"] = "Los Angeles International Airport",
["MEL"] = "Melbourne Tullamarine Airport"
};