Q:

Put break in function c#

I have a switch statement:
swtich(x)
{
    case 1:
           ...
           break;
    case 2:
           ...
           break;
}

I want to put the ... code in a function but I want to put the break too... So I want something like that
void func()
{
     ...;
     break;
}

swtich(x)
{
    case 1:
           func();
    case 2:
           func();
}

Break gives error (I know why) but what I can do?

A:

You can't. Best you can do is:
swtich(x)
{
    case 1:
           func();
           break;
    case 2:
           func();
           break;
}

See here for a discussion of what break is for:

The break statement terminates the closest enclosing loop or switch statement in which it appears. Control is passed to the statement that follows the terminated statement, if any. 

If you put it in a function, how will it know which loop or switch statement it's supposed to apply to?

