<?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 : Question about Contains</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Question about Contains</description>
  <pubDate>Mon, 13 Apr 2026 19:10:13 -700</pubDate>
  <lastBuildDate>Thu, 24 May 2012 10:53:21 -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=3451</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>Question about Contains :   The AsScalarAsync extension...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3451&amp;PID=13643#13643</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> 3451<br /><strong>Posted:</strong> 24-May-2012 at 10:53am<br /><br />The AsScalarAsync extension is used to asynchronously execute what would otherwise be an "immediate execution" query.&nbsp; These are queries using a .First() or .Sum() or .Contains() or similar operator, which because they will be executed immediately and synchronously, are not allowed in Silverlight.<div>&nbsp;</div><div>To use .Contains, or .Any, or .Count, which I think would also work in your scenario, you can do something like the following:</div><div>&nbsp;&nbsp; var op = repository.Manager.DBOARD.Select(o1 =&gt; o1.ID).AsScalarAsync().Contains(dboard.ID);</div><div>or</div><div>&nbsp;&nbsp; var op = repository.Manager.DBOARD.Where(o1 =&gt; o1.ID == dboard.ID).AsScalarAsync().Any();</div><div>or</div><div>&nbsp;&nbsp; var op = repository.Manager.DBOARD.Where(o1 =&gt; o1.ID == dboard.ID).AsScalarAsync().Count();</div><div>&nbsp;</div><div>Note that in all cases an EntityScalarQueryOperation is returned, not a query.&nbsp; This is because the query is still executed immediately.</div><div>&nbsp;</div><div>You can read more about AsScalarAsync here - <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/async-immediate-executi&#111;n" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/async-immediate-execution</a></div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Thu, 24 May 2012 10:53:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3451&amp;PID=13643#13643</guid>
  </item> 
  <item>
   <title>Question about Contains : Hello,I&amp;#039;m writing my first...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3451&amp;PID=13639#13639</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1136" rel="nofollow">pponzano</a><br /><strong>Subject:</strong> 3451<br /><strong>Posted:</strong> 24-May-2012 at 1:14am<br /><br />Hello,<br>I'm writing my first silverlight application that makes access to the Manager direcly without passing from storedprocedure... <br>I've got a small issue with the contains...<br><br>if I do<br><br>       var dboard = (sender as RadDataForm).CurrentItem as DBOARD;<br><br>                    var query = repository.Manager.DBOARD.Where(o1 =&gt; o1.ID == dboard.ID).AsScalarAsync&lt;DBOARD&gt;();<br>                    query.ExecuteAsync(op =&gt;<br>                    {<br>                        op.Results.Cast&lt;DBOARD&gt;().Count();<br>                        repository.Manager.SaveChangesAsync();<br>                    });<br><br>It works....<br><br>if I do                     var query = repository.Manager.DBOARD.Contain(dboard) it doesn't have the AsScalarAsync and if I run this I got<br>Queries in Silverlight must be executed asynchronously.<br><br>What am I doing wrong?<br><br>Thanks<br>]]>
   </description>
   <pubDate>Thu, 24 May 2012 01:14:14 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3451&amp;PID=13639#13639</guid>
  </item> 
 </channel>
</rss>