IdeaBlade.EntityModel.Compat Assembly > IdeaBlade.EntityModel Namespace > Coroutine Class : Return Method |
'Declaration
Public Shared Function Return( _ ByVal result As Object _ ) As CoroutineOperation
'Usage
Dim result As Object Dim value As CoroutineOperation value = Coroutine.Return(result)
public static CoroutineOperation Return( object result )
public void SampleCoroutineWithResult() { var op = Coroutine.Start(CoroutineWithResult); op.Completed += (s, e) => { MessageBox.Show(e.Result.ToString()); }; } public IEnumerable<INotifyCompleted> CoroutineWithResult() { // A few async actions yield return _em1.Customers.Take(3).ExecuteAsync(); yield return _em1.Areas.Take(2).ExecuteAsync(); // Return something to the caller (showing that the result // returned to caller is whatever you want it to be). yield return Coroutine.Return("Hello World"); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2