I want to initialize a static readonly array of ValueTuples, I'd like to use the approach from this SO answer:
var tupleList = new (int Index, string Name)[]
{
(1, "cow"),
(5, "chickens"),
(1, "airplane")
};
But it doesn't work for a static member, I have to declare the type of tupleList. I can do it as a Tuple like this, but I don't know how to do it as a ValueTuple:
static readonly Tuple<uint, string>[] tupleList= new Tuple<uint, string>[]
{
new Tuple<uint, string>(0x1, "string1"),
...
};
But I'd prefer to use the cleaner format if I can figure out the right type, so far I've tried a variety of types with no luck.