<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Coroutine Error Handling</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Coroutine Error Handling</description>
  <pubDate>Tue, 14 Apr 2026 07:48:37 -700</pubDate>
  <lastBuildDate>Fri, 18 Mar 2011 17:02:01 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2565</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Coroutine Error Handling : DevForce does actually check for...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10206#10206</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2565<br /><strong>Posted:</strong> 18-Mar-2011 at 5:02pm<br /><br /><P>DevForce does actually check for errors after each async operation, and does not call subsequent operations in the iterator block if a prior one failed, unless you've marked the error as handled.&nbsp; If you set up a handler for the Coroutine completed you can see there if an error occurred, plus all the "Notifications" for each async operation up to and including the operation which failed.&nbsp; You don't need to include error checking within your iterator unless you want to, or if you will be marking the error as handled so that subsquent operations can run.</P><DIV></DIV>]]>
   </description>
   <pubDate>Fri, 18 Mar 2011 17:02:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10206#10206</guid>
  </item> 
  <item>
   <title>Coroutine Error Handling : This was more of a question of,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10198#10198</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=452" rel="nofollow">ken.nelson</a><br /><strong>Subject:</strong> 2565<br /><strong>Posted:</strong> 17-Mar-2011 at 12:50pm<br /><br />This was more of a question of, "what is DevForce doing under the hood automatically?".&nbsp; From the sound of it, my conclusion is that DevForce is not checking the error state of the each async operation while executing in a coroutine.&nbsp; And this is perfectly ok, I just wasn't sure if it was necessary to check for errors after each operation or if it was already being done under the hood.<DIV>&nbsp;</DIV><DIV>Thanks!</DIV>]]>
   </description>
   <pubDate>Thu, 17 Mar 2011 12:50:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10198#10198</guid>
  </item> 
  <item>
   <title>Coroutine Error Handling : Ken, write yourself some extension...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10197#10197</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=704" rel="nofollow">mikewishart</a><br /><strong>Subject:</strong> 2565<br /><strong>Posted:</strong> 17-Mar-2011 at 9:38am<br /><br />Ken, write yourself some extension methods such as:<br><br>&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br>&nbsp;&nbsp;&nbsp; /// Same as ExecuteAsync() except it tests for an error before returning the result<br>&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br>&nbsp;&nbsp;&nbsp; public static EntityQueryOperation&lt;T&gt; ExecuteAsyncResult&lt;T&gt;(this IEntityQuery&lt;T&gt; query,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Action&lt;IEnumerable&lt;T&gt;&gt; userCallback)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return query.ExecuteAsync(op =&gt; CheckExecuteAsyncResult(op, userCallback), null);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br>&nbsp;&nbsp;&nbsp; /// Same as ExecuteAsync() except it tests for an error before returning the result<br>&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br>&nbsp;&nbsp;&nbsp; public static EntityQueryOperation&lt;T&gt; ExecuteAsyncResult&lt;T&gt;(this IEntityQuery&lt;T&gt; query,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Action&lt;IEnumerable&lt;T&gt;, object&gt; userCallback, object userState)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return query.ExecuteAsync(op =&gt; CheckExecuteAsyncResult(op, r =&gt; userCallback(r, op.UserState)), userState);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; private static void CheckExecuteAsyncResult&lt;T&gt;(EntityQueryOperation&lt;T&gt; op,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Action&lt;IEnumerable&lt;T&gt;&gt; userCallback)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (op.HasError)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new Exception(op.Error.Message);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; userCallback(op.Results);<br>&nbsp;&nbsp;&nbsp; }<br><br>]]>
   </description>
   <pubDate>Thu, 17 Mar 2011 09:38:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10197#10197</guid>
  </item> 
  <item>
   <title>Coroutine Error Handling : Hi Ken,   It is always a good...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10185#10185</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2565<br /><strong>Posted:</strong> 16-Mar-2011 at 12:13pm<br /><br />Hi Ken, <DIV>&nbsp;</DIV><DIV>It is always a good idea, and the developers responsability, to check for errors.</DIV><DIV>&nbsp;</DIV><DIV>On a coroutine operation you should check for errors before yielding to the Coroutine consumer:</DIV><DIV>&nbsp;</DIV><DIV><DIV =" code"><SPAN style="COLOR: #008000"><SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN><BR></SPAN><SPAN style="COLOR: #0000ff">private</SPAN> IEnumerable&lt;INotifyCompleted&gt; LoadTopCustomersCoroutine() {<BR><BR>&nbsp;&nbsp;var userId = CurrentUser.UserId;<BR><BR>&nbsp;&nbsp;var allCustOperation = Manager.Customers.ExecuteAsync();<BR><BR><SPAN style="COLOR: #008000">&nbsp; // event handler<BR></SPAN>&nbsp; var allCustOperation.Completed += (s1, args1) =&gt; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #0000ff">if</SPAN> (args1.HasError) HandleError(args1);<BR>&nbsp;&nbsp;};<BR><BR><SPAN style="COLOR: #0000ff">&nbsp; yield</SPAN> <SPAN style="COLOR: #0000ff">return</SPAN> allCustOperation; <SPAN style="COLOR: #008000">// SUSPEND<BR></SPAN>&nbsp; <SPAN style="COLOR: #008000">// more code<BR></SPAN>}</DIV><DIV =" code"><SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV><DIV =" code">&nbsp;</DIV><DIV =" code">or</DIV><DIV =" code">&nbsp;</DIV><DIV =" code"><SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV><DIV =" code"><DIV =" code"><SPAN style="COLOR: #0000ff">private</SPAN> IEnumerable&lt;INotifyCompleted&gt; LoadTopCustomersCoroutine() {</DIV><DIV =" code">&nbsp;&nbsp;var allCustOperation = Manager.Customers.ExecuteAsync(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #008000">// Callback checks for error<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op =&gt; { <SPAN style="COLOR: #0000ff">if</SPAN> (op.HasError) HandleError(op); }<BR>&nbsp;&nbsp;&nbsp;&nbsp;);<BR><BR><SPAN style="COLOR: #0000ff">&nbsp; yield</SPAN> <SPAN style="COLOR: #0000ff">return</SPAN> allCustOperation;&nbsp;<SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008000">&nbsp; // more code<BR></SPAN>}</DIV><DIV =" code"><SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//<SPAN style="COLOR: #008000">//</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV><DIV =" code">&nbsp;</DIV><DIV =" code">&nbsp;</DIV><DIV =" code">If an error occurs, you can let the error bubble up to the outer Coroutine or you can take care of the exception and mark the error as handled:</DIV><DIV =" code">&nbsp;</DIV><DIV =" code">op.<a href="http://drc.ideablade.com/Api&#068;ocumentati&#111;n/webframe.html?IdeaBlade.EntityModel~IdeaBlade.EntityModel.Async&#069;ventArgs~MarkErrorAsHandled.html" target="_blank">MarkErrorAsHandled</A>();</DIV><DIV =" code">&nbsp;</DIV><DIV =" code">You will also find this information in our <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Asynchr&#111;nous-Coroutine-Errors" target="_blank">DevForce Resource Center</A>.</DIV><DIV =" code">&nbsp;</DIV><DIV =" code">Regards,</DIV><DIV =" code">&nbsp;&nbsp; Silvio.</DIV></DIV></DIV><span style="font-size:10px"><br /><br />Edited by sbelini - 16-Mar-2011 at 12:16pm</span>]]>
   </description>
   <pubDate>Wed, 16 Mar 2011 12:13:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10185#10185</guid>
  </item> 
  <item>
   <title>Coroutine Error Handling : Is it necessary to error check...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10184#10184</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=452" rel="nofollow">ken.nelson</a><br /><strong>Subject:</strong> 2565<br /><strong>Posted:</strong> 16-Mar-2011 at 8:05am<br /><br /><DIV>Is it necessary to error check each coroutine operation's error state after each yield return or is it eoungh to handle&nbsp;errors in the Coroutine completed callback?&nbsp; (Is the red highlighted code below necessary?)</DIV><DIV>&nbsp;</DIV><DIV>Without the use of a Coroutine, my code would look something like the following, with error checked after each async call has completed:</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>private void LoadData() {</DIV><DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp; em.Customers.Where().ExecuteAsync((customerArgs) =&gt; </DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; {</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (customerArgs.HasError) { // handle error }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else </DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; em.Orders.Where().ExecuteAsync((orderArgs) =&gt; </DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (orderArgs.HasError)&nbsp;{ // handle error }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp; });<BR>}</DIV><DIV></pre></td></tr></table></DIV><DIV>&nbsp;</DIV><DIV>Translating to Coroutine, my code is:</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>private void LoadData()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp; Coroutine.Start(CoroutineActions, (completed) =&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (completed.HasError) { // handle error }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp; });<BR>}</DIV><DIV>&nbsp;</DIV><DIV>private IEnumerable&lt;INotifyCompleted&gt; CoroutineActions()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp; var op1 = em.Customers.Where().ExecuteAsync();<BR>&nbsp;&nbsp;&nbsp;&nbsp; yield return op1;</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#ff0000><strong>&nbsp;&nbsp;&nbsp;&nbsp; // Do I have to continue to error check after each async operation, or</strong></FONT></DIV><DIV><FONT color=#ff0000><strong>&nbsp;&nbsp;&nbsp;&nbsp; // is it ok to skip this?</strong></FONT></DIV><DIV><strong><FONT color=#ff0000>&nbsp;&nbsp;&nbsp;&nbsp; </FONT></strong><strong><FONT color=#ff0000>if (op1.HasError) { // handle error }<BR>&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp; {<BR></FONT></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var op2 = em.Orders.Where().ExecuteAsync();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yield return op2;<BR><FONT color=#cc0000>&nbsp;<strong>&nbsp;&nbsp;&nbsp; }<BR></strong></FONT>}</DIV><DIV></pre></td></tr></table></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 16 Mar 2011 08:05:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2565&amp;PID=10184#10184</guid>
  </item> 
 </channel>
</rss>