How to await on async delegate

前端 未结 3 1334
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 02:17

In one of MVA videos i saw next construction:

static void Main(string[] args)
{
    Action testAction = async () =>
    {
        Console.WriteLine(\"In\");
          


        
3条回答
  •  日久生厌
    2021-02-01 02:47

    Recently I found that NUnit able to await async voidtests. Here is good description how it works: How does nunit successfully wait for async void methods to complete?

    You won't use it in regular tasks, but it's good to know that it is possible

提交回复
热议问题