Код: Выделить всё
public (string a, string b) GetTupleResult() {
return ("result a", "result b");
}
public void MethodWithTwoStringParameters(string a, string b) {
Debug.WriteLine(a);
Debug.WriteLine(b);
}
public void Main() {
// Deconstruct first, call later ==> WORKS
(string a, string b) = GetTupleResult();
MethodWithTwoStringParameters(a, b);
// Inline solution ==> IS SUCH A THING POSSIBLE?
MethodWithTwoStringParameters(...GetTupleResult());
}
Я знаю, что могу изменить MethodWithTwoStringParameters, чтобы принять кортеж в качестве параметра, или создать метод-оболочку/перегрузку. Но я пытаюсь донести не это.
Подробнее здесь: https://stackoverflow.com/questions/641 ... ss-operato