Async Task in C# with Timer

Godot Version

4.2.1 (mono)

Question

How can this piece of code be translated from GDScript to C#?
The problem lies in “await”, I can’t find a way to implement it in its translation to C#.

var state: int = 0:
	set(value):
		match value:
			0:
				voidFunction0()
			1:
				voidFunction1a()
				state = value
				await get_tree().create_timer(5).timeout
				state = 0
				voidFunction1b()
				return
		state = value

I tried, but I can’t.
This is my try, just in case:

private int _state=0;
public int State
{
    set
    {
        switch (value)
        {
            case 0:
                voidFunction0();
                break;
            case 1:
                voidFunction1a();
                _state = value;
                System.Threading.Tasks.Task.Run(async () =>
                {
                    await ToSignal(GetTree().CreateTimer(5), "Timeout");
                }).Wait();
                _state = 0;
                voidFunction1b();
                return;
        }
        _state = value;
    }
     get{ return _state; }
}

You could connect to the timer timeout signal

		case 1:
			voidFunction1a();
            _state = value;
            GetTree().CreateTimer(5).Timeout += () => {
				_state = 0;
				voidFunction1b();
			};
        	return;

Your code worked!
Although, wouldn’t it be possible that this Timer only had the role of waiting (“await”)? And that voidFunction1b() was outside and after that Timer.
Something like this one:

case 1:
			voidFunction1a();
            _state = value;
            GetTree().CreateTimer(5).Timeout += () => {
				//Nothing, the code is outsite and after this block
			};
            _state = 0;
            voidFunction1b();
        	return;

The problem is the following:
If I put the code outside and after the created TIMER block, that code will be executed IMMEDIATELY, ignoring the TIMER timeout.

GOOD NEWS!
I managed to “translate” that code with asynchronous behavior from GDScript to C#, here is the answer:

private int _state=0;
public int State
{
    set
    {
        Func<int, Task> LambdaSetter = async (int num) =>
        {
            switch (value)
            {
                case 0:
                    voidFunction0();
                    break;
                case 1:
                    voidFunction1a();
                    _state = value;
                    await ToSignal(GetTree().CreateTimer(5.0),Timer.SignalName.Timeout);
                    _state = 0;
                    voidFunction1b();
                    return;
            }
            _state = value;
        };
        LambdaSetter(value);

    }
    get { return _state; }
}