Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要通过 indexTuple的属性访问,如果没有我想抛出的索引的属性IndexOutOfRangeException。
Tuple
IndexOutOfRangeException
例如:
Tuple<T1, T2, T3> // has 3 properties: Item1, Item2, Item3
那么有没有一种方法可以让我获得一些属性Tuple?
var v = new Tuple<int, int, int>(1, 2, 3); var count = v.GetType().GenericTypeArguments.Length;