Has implemented exactly as described, but get this error:
Error 3 Overload resolution failed because no accessible 'Start' can be called without a narrowing conversion:
'Public Shared Function Start(
coroutine As System.Func(Of System.Collections.Generic.IEnumerable(Of IdeaBlade.EntityModel.INotifyCompleted)),
[completedHandler As System.Action(Of IdeaBlade.EntityModel.CoroutineOperation) = Nothing])
As IdeaBlade.EntityModel.CoroutineOperation':
Argument matching parameter 'coroutine' narrows
from 'System.Collections.Generic.IEnumerable(Of System.Func(Of IdeaBlade.EntityModel.INotifyCompleted))'
to 'System.Func(Of System.Collections.Generic.IEnumerable(Of IdeaBlade.EntityModel.INotifyCompleted))'.
MY CODE IS AS FOLLOWS:
Can someone tell me whats wrong.
Function LoadAll(ByVal manager As myEntityManager) As IEnumerable(Of Func(Of INotifyCompleted))
' List of asynchronous functions for the Coroutine to execute serially
Dim funcList = New List(Of Func(Of INotifyCompleted))
' Get all
Dim loadFnc As Func(Of INotifyCompleted) = _
Function()
Return manager.Customers.ExecuteAsync() ' return an INotifyCompleted
End Function
funcList.Add(loadFnc)
' return the list
Return funcList
End Function
' Sequence from my main routine
Dim op = Coroutine.Start(LoadAll(_eMgr))
AddHandler op.Completed, _
Sub(s As Object, e As CoroutineCompletedEventArgs)
If e.CompletedSuccessfully Then
Debug.Write("All were loaded")
Else
Debug.Write(e.Error.Message)
End If
End sub