Stats

184 Contributors: 4 Sunday, September 11, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Function with multiple return values

Remarks

There is no inherent answer in C# to this - so called - need. Nonetheless there are workarounds to satisfy this need.

The reason I qualify the need as "so called" is that we only need methods with 2 or more than 2 values to return when we violate good programming principals. Especially the Single Responsibility Principle.

Hence, it would be better to be alerted when we need functions returning 2 or more values, and improve our design.

Related Examples