How to return a named tuple with only one field
10
1
I wrote a function in c# which initially returned a named tuple. But now, I only need one field of this tuple and I would like to keep the name because it helps me to understand my code. private static (bool informationAboutTheExecution, bool field2thatIdontNeedAnymore) doSomething() { // do something return (true, false); } This function compile. But It's the following function that I want private static (bool informationAboutTheExecution) doSomething() { // do something return (true); } the error messages: Tuple must containt at least two elements cannot implcitly convvert type 'bool' to '(informationAboutTheExecution,?) Has somebody a solution to keep the name of the returned value?
...