.NET 4 equivalent of Task.WhenAll()

后端 未结 3 838
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 08:09

In .NET 4, is there any functional equivalent to .NET 4.5\'s System.Threading.Tasks.Task.WhenAll()?

The goal is to wrap up multiple async tasks into a single one that is

3条回答
  •  臣服心动
    2021-02-07 08:55

    In .NET Framework 4.0 WhenAll and WhenAny can be used with installed AsyncCTP in case of Visual Studio 2010 or Async Targeting Pack in case of Visual Studio 2012.

    The WhenAll and WhenAny methods are then offered on the TaskEx type.

提交回复
热议问题