If I have nested functions in C#, how to exit from both function at once when executing inner function code. (Return; only exits from executing function.)
public void Function1()
{
Function2();
}
public void Function2()
{
if (1 == 1)
{
//Exit from both functions
}
}
Use return codes instead of void functions. Function1 can return if Function2 fails like so: