user4951
user4951

Reputation: 33060

How do I use continueWith to continue a task with another task?

    Dim listOfTask = New List(Of Task)
    For Each account In uniqueAccounts().Values
        Dim newtask = account.conditionalInitializeAsync()
        Dim nexttask = account.getPairsPriceStepAsync()
        listOfTask.Add(newtask)
        listOfTask.Add(nexttask)
        Dim nexttaskaftenewtask = newtask.ContinueWith(nexttask) 'compiler warning
    Next

Instead of list

        listOfTask.Add(newtask)
        listOfTask.Add(nexttask)

I want to do

        listOfTask.Add(nexttaskaftenewtask )

How do I do so?

Upvotes: 0

Views: 114

Answers (1)

Dan Scott
Dan Scott

Reputation: 564

I can compile the following without error or warning. Hope this helps.

 Dim nexttaskaftenewtask = newtask.ContinueWith(New Action(Of Task)(Function() nexttask))

Upvotes: 1

Related Questions