Try creating an instance of an array with new
and tuple instances with the keywordnew
private static readonly ValueTuple<string, string>[] test = new ValueTuple<string, string>[]{
new ValueTuple<string, string>("foo", "bar"),
new ValueTuple<string, string>("baz", "foz")
};
or with C # 7 tuple syntax
private static readonly ValueTuple<string, string>[] test = new ValueTuple<string, string>[]{
("foo", "bar"),
("baz", "foz")
};
Update:
Currently, all the ads with the question and this answer work fine with Rider 2017.1 build # RD-171.4456.1432 and .NET Core 1.0.4. The simplest is that @ZevSpitz is mentioned in the comments and looks like this:
private static readonly (string, string)[] test = {("foo", "bar"), ("baz", "foz")};
There is no need to add a specific type for ValueTuple
. Note that for .NET Core, you must install the NuGet package System.ValueTuple
.