[Solved] c# anonymous type declaration with parentheses [closed]


As you already mentioned, this is ValueTuple. You can see here for some description and comparison with a “ordinal” Tuples. The official documentation also available here.

The code you showed is the just a typical declaration of such a ValueTuple. The syntax was introduced in C# 7.0.

To replace var, you can use the following:

(string firstName, string lastName, int born, int published) jh = (firstName: "Jupiter", lastName: "Hammon", born: 1711, published: 1761);

4

solved c# anonymous type declaration with parentheses [closed]