<?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 : Need help with casting</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Need help with casting</description>
  <pubDate>Mon, 13 Apr 2026 15:01:55 -700</pubDate>
  <lastBuildDate>Thu, 23 Dec 2010 08:22:32 -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=2393</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>Need help with casting : Yes, you can return whatever you...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9466#9466</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> 2393<br /><strong>Posted:</strong> 23-Dec-2010 at 8:22am<br /><br />Yes, you can return whatever you want.]]>
   </description>
   <pubDate>Thu, 23 Dec 2010 08:22:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9466#9466</guid>
  </item> 
  <item>
   <title>Need help with casting : Can I return an observablecollection...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9465#9465</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2393<br /><strong>Posted:</strong> 23-Dec-2010 at 8:19am<br /><br />Can I return an observablecollection from a Coroutine?<DIV></DIV>]]>
   </description>
   <pubDate>Thu, 23 Dec 2010 08:19:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9465#9465</guid>
  </item> 
  <item>
   <title>Need help with casting : If you&amp;#039;re returning an En...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9464#9464</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> 2393<br /><strong>Posted:</strong> 23-Dec-2010 at 8:17am<br /><br />If you're returning an EntityQueryOperation&lt;EventStepType&gt; from the Coroutine, then grab its Results - <DIV>&nbsp;&nbsp; var op = steps.Result as EntityQueryOperation&lt;EventStepType&gt;;</DIV><DIV>&nbsp;&nbsp; var results = op.Results;</DIV><DIV>&nbsp;</DIV><DIV>I'm wondering why the return from the Coroutine is an EntityQueryOperation; it might be a bit simpler to return just the desired results from it, not a *Operation.</DIV>]]>
   </description>
   <pubDate>Thu, 23 Dec 2010 08:17:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9464#9464</guid>
  </item> 
  <item>
   <title>Need help with casting : My code calls a Coroutine which...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9462#9462</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2393<br /><strong>Posted:</strong> 23-Dec-2010 at 7:45am<br /><br />My code calls a Coroutine which performs a couple of queries and calculations and finally returns <DIV>&nbsp;</DIV><DIV>Ideablade.EntityModel.CoRoutineOperation. Which in this case is assigned to step in the following piece of code.</DIV><DIV>&nbsp;</DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> steps = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Coroutine</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Start(() =&gt; </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>AvailableStepsSelector</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.RetrieveAvailableSteps(currentEvent));</P><P>steps.Completed += (sender, args) =&gt; {</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (args.CompletedSuccessfully) {</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp;&nbsp;&nbsp; var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> type = steps.Result.GetType();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#ff0000> // type = Ideablade.EntityModel.EntityQueryOperation </FONT><FONT color=#ff0000>&#091;EventStepType&#093;</FONT></P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>&nbsp;&nbsp;&nbsp; var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> results = steps.Result </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>as</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>IEnumerable</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>EventStepType</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;;&nbsp;<FONT color=#ff0000> // before the assignment 25 rows --- after null</FONT></P><P>&nbsp;&nbsp;&nbsp; ResetStepTypesList(results);</P><P>}</P><DIV></DIV><DIV>When I do a GetType() on steps.Result, I get an Ideablade.EntityModel.EntityQueryOperation &#091;EventStepType&#093;, which is fine. On the very next line I cast steps.Result as IEnumerable&lt;EventStepType&gt; and the assign it to results, thinking that results will now hold the returned data. WRONG, it is null. My ultimate goal is to pass results to ResetStepTypesList where I will do the following</DIV><DIV>&nbsp;</DIV><DIV>public void ResetStepTypesList(IEnumerable&lt;EventStepType stepTypes)</DIV><DIV>{</DIV><DIV>&nbsp;&nbsp; StepTypes.Clear();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#ff0000> //StepTypes is an ObservableCollection of EventStepType</FONT></DIV><DIV>&nbsp;&nbsp; StepTypes.ForEach(results.Add);</DIV><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>What am I doing wrong here between steps.Result and var results?</FONT></FONT></DIV>]]>
   </description>
   <pubDate>Thu, 23 Dec 2010 07:45:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2393&amp;PID=9462#9462</guid>
  </item> 
 </channel>
</rss>