'How blazor components detect if an event method is async or not

Let's suppose this 2 methods:

private void Method1()
{
   ...
}

private async Task Method2()
{
   ...
}

Here is how I have to call this methods:

Method1();
await Method2();

I cannot do that:

await Method1();
Method2();

Now let's imagine a component with an event:

<MyComponent OnEvent="Method1" />
<MyComponent OnEvent="Method2" />

In this case, there is no need to put an await for async method. My question is how blazor can detect if the method used in the event is async or not ?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source