I have boxed tuple:
(int, string) tuple = (1, "abc");
object box = tuple;
How to obtain tuple from box
? What is the right syntax to cast object
back to tuple?
My attempt:
var deconstruct = (int, string)box;
is obviously wrong:
Error CS1525 Invalid expression term 'int'
Error CS1525 Invalid expression term 'string'
Error CS1002 ; expected
Error CS0201 Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
(type) expr
. The type of the tuple is(int, string)
. Ergo:((int, string)) box
. – Winnow