C# program to Create MultiKey dictionary using Tuple

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 2945
//declare a dictionary object that can hold multiple keys
var multiKeyDictionary = new Dictionary<Tuple<string, string>, string>();

//add some data to that
Enumerable
.Range(1, 10)
.ToList()
.ForEach
(
i => multiKeyDictionary.Add(
new Tuple<string, string>("100" + i, "900000000" + i) //multi-key or composite-key
, "User" + i // the values
)

);

Comments or Responses

Login to post response