I cant seem to get this syntax correct or any resource that has an example of this.
Am trying something like:
Row = new Dictionary<string, string> [] [{"A":"A"}, {"B":"B"}]
Any idea on this syntax?
I cant seem to get this syntax correct or any resource that has an example of this.
Am trying something like:
Row = new Dictionary<string, string> [] [{"A":"A"}, {"B":"B"}]
Any idea on this syntax?
You can try this way:
Row = new Dictionary<string, string>[]
{
new Dictionary<string, string> { {"A", "A"} },
new Dictionary<string, string> { {"B", "B"} }
};
Use the collection initializers for both the array and the inner dictionaries:
var arrayOfDictionaries = new Dictionary<string, string>[]
{
new Dictionary<string, string>() { {"A", "A"} },
new Dictionary<string, string>() { {"B", "B"} }
};