I need to create pairs / triples of something and store it somewhere. How can I do it?
I tried:
for (int i = 0; i < 100; i++)
{
var item=new { a=i , b="lala" ,c=4.5m}; //anonymous type
}
But then I thought: List<what>?
I could use dynamic but I want Intellisense.
(I could have also use Tuple<int,string,decimal> but if I already have what I need (=new { a=i , b="lala" ,c=4.5m};), why should I use other type (tuple)? )
Is there any solution to this?
You can use type inference