recursiveContradiction recursiveContradiction - 3 months ago 6
C# Question

Need a two dimensional [string][int] array to strore DateTimes

I can not find anywhere a two dimensional [string][int] array which could assign many DateTime for a string.

Example:
Array["Branch"].Add(Date);

Answer

Sounds like you want to use a dictionary of Lists, like so

var dict = new Dictionary<string,List<DateTime>>();

then you add lists for a string like so:

dict["Branch"] = new List<DateTime>();

and add dates like so:

dict["Branch"].Add(Date);