<?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 : Server side/Client side</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Server side/Client side</description>
  <pubDate>Fri, 10 Apr 2026 21:37:22 -700</pubDate>
  <lastBuildDate>Fri, 25 Sep 2009 12:15:25 -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=1495</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>Server side/Client side :   Originally posted by tj62I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1495&amp;PID=5482#5482</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1495<br /><strong>Posted:</strong> 25-Sep-2009 at 12:15pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by tj62</strong></em><br /><br />I have many queries that are of such nature that I have to do many queries first before I return the real data to the client. It is obvious that it is more appropirate doing all those server side to minimize round trips from client to server<br></td></tr></table><br><br>It is often possible to string together what you might otherwise consider multiple queries, so that the entire expression can be submitted to the server in a single SQL statement. E.g.,<br><br>&nbsp;&nbsp;&nbsp;&nbsp; var query = _mgr.Customers.Where(c=&gt;c.Country == "Brazil");<br>&nbsp;&nbsp;&nbsp;&nbsp; var query2 = query.SelectMany(c=&gt;c.Orders);<br><br>can be written as<br><br>&nbsp;&nbsp;&nbsp;&nbsp; var query = _mgr.Customers.Where(c=&gt;c.Country == "Brazil").SelectMany(c=&gt;c.Orders);<br><br>and so forth.<br><br><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by tj62</strong></em><br /><br />: <br>Probably it is right to callInvokeServerMethodAsync() used client side, but how and where should Iimplement the GetCustomers(string userID) server side? Should it beimplemented as a member of EntCustomers?...hardly<br>because I do not have any access to EntCustomerSet there.<br></td></tr></table><br><br>Yes, you do have access to EntCustomerSet. The server method gets an EntityManager parameter.<br>You can do any series of queries or other operations in your server-side method, then return any result.<br><br><br>]]>
   </description>
   <pubDate>Fri, 25 Sep 2009 12:15:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1495&amp;PID=5482#5482</guid>
  </item> 
  <item>
   <title>Server side/Client side : Hi, I&amp;#039;m quite new to Silverlight...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1495&amp;PID=5476#5476</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=508" rel="nofollow">tj62</a><br /><strong>Subject:</strong> 1495<br /><strong>Posted:</strong> 25-Sep-2009 at 6:26am<br /><br />Hi, I'm quite new to Silverlight and DevForce&nbsp;. I fully understand how I can do LINQs to Entities&nbsp;at client side. However in my applications I have many queries that are of such nature that I have to do many queries first before I return the real data to the client. It is obvious that it is more appropirate doing all those server side to minimize round trips from client to server: Here is a small example<EM>&nbsp;</EM>I did for tesint using a console app.:<DIV>&nbsp;</DIV><DIV>private static void GetCustomers(string userID)<BR>{<BR>&nbsp;var userQ = (from user in m_mgr.EntUserSet<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where user.p_userID == userID<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select new {user, userGroups = user.p_UserGroups}).FirstOrDefault();</DIV><DIV>&nbsp;var userGroups = (from u in userQ.userGroups<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select u.p_userID).ToList();<BR>&nbsp;userGroups.Add(userID);</DIV><DIV>&nbsp;var customerIDs = m_mgr.EntPointGroupAccessSet<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.WhereIn( e =&gt; e.p_userID , userGroups )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Select( e =&gt; new {customerID = e.p_customerID} ).Distinct();</DIV><DIV><FONT color=#ff0000>&nbsp;var customerQ = m_mgr.EntCustomerSet<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;.OrderBy(c =&gt; c.p_name)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .WhereIn(c =&gt; c.p_customerID, (from d in customerIDs select d.customerID).ToArray());<BR></FONT>&nbsp;foreach( EntCustomer c in customerQ )<BR>&nbsp;{<BR>&nbsp;&nbsp;Console.WriteLine( "Customer = " + c.p_name );<BR>&nbsp;&nbsp;Console.WriteLine();<BR>&nbsp;}<BR>}</DIV><DIV>&nbsp;</DIV><DIV>Now I want to move this functionalety to my Sileverlight app. Only the result of customerQ (the red one)&nbsp;is of importance at the client side. It would be redicelous to run the other 3 queries on client side that are only used to get parmeters for the customerQ.<BR>What is the best practise to implement such server side functions (GetCustomers(string userID)) server side and how to call those client side. Probably it is right to call InvokeServerMethodAsync() used client side, but how and where should I implement the GetCustomers(string userID) server side? Should it be implemented as a member of EntCustomers?...hardly becuase do not have anyaccess to EnCustomerSet there.<BR><BR>PS: the WhereIn function above is a "QueriableExetension" to implement the common IN of SQL not currently available in LINQ to entites...This only creates an Or-squence.</DIV>]]>
   </description>
   <pubDate>Fri, 25 Sep 2009 06:26:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1495&amp;PID=5476#5476</guid>
  </item> 
 </channel>
</rss>