<?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 : Entity And Remote Service Method Call</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Entity And Remote Service Method Call</description>
  <pubDate>Sun, 21 Jun 2026 04:02:34 -700</pubDate>
  <lastBuildDate>Tue, 02 Nov 2010 09:32:40 -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=2253</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>Entity And Remote Service Method Call : Sergio,  It&amp;#039;s still unclear...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=9002#9002</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> 2253<br /><strong>Posted:</strong> 02-Nov-2010 at 9:32am<br /><br />Sergio,<DIV>&nbsp;</DIV><DIV>It's still unclear to me...</DIV><DIV>Despite of that, the solution you proposed looks ok.</DIV><DIV>&nbsp;</DIV><DIV>Silvio.</DIV>]]>
   </description>
   <pubDate>Tue, 02 Nov 2010 09:32:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=9002#9002</guid>
  </item> 
  <item>
   <title>Entity And Remote Service Method Call :   Hello Sbelini,I do not want...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=9001#9001</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=979" rel="nofollow">antonio_sergio</a><br /><strong>Subject:</strong> 2253<br /><strong>Posted:</strong> 02-Nov-2010 at 3:45am<br /><br /><P>Hello Sbelini,<BR>I do not want to write the data in the database (at least for now).<BR>I want to change the data on the server side because I need to read some data from database (not visible on the exemple).</P><P>Regards,<BR>Sérgio Magalhães</P>]]>
   </description>
   <pubDate>Tue, 02 Nov 2010 03:45:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=9001#9001</guid>
  </item> 
  <item>
   <title>Entity And Remote Service Method Call : Hi Sergio,  I&amp;#039;m assuming...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8985#8985</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> 2253<br /><strong>Posted:</strong> 29-Oct-2010 at 12:12pm<br /><br />Hi Sergio,<DIV>&nbsp;</DIV><DIV>I'm assuming you don't want to save the changes to the datasource. (no em.Save() in the server side code)</DIV><DIV>&nbsp;</DIV><DIV>Also, is there any particular reason to not edit the entity in the client itself?</DIV>]]>
   </description>
   <pubDate>Fri, 29 Oct 2010 12:12:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8985#8985</guid>
  </item> 
  <item>
   <title>Entity And Remote Service Method Call :     Hello Silvio, first of...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8903#8903</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=979" rel="nofollow">antonio_sergio</a><br /><strong>Subject:</strong> 2253<br /><strong>Posted:</strong> 25-Oct-2010 at 1:46am<br /><br /><DIV style="margin: 0cm 0cm 10pt;">Hello Silvio, first of all thanks you for your rapid response.</DIV><DIV style="margin: 0cm 0cm 10pt;">My idea was to send an object (SalesOrderHeader) to the "server".</DIV><DIV style="margin: 0cm 0cm 10pt;">In the "server"&nbsp;modify this object and sends it to the client with the modified state.</DIV><DIV style="margin: 0cm 0cm 10pt;">I managed to do it, but do not know if it's the best way.</DIV><DIV style="margin: 0cm 0cm 10pt;">&nbsp;</DIV><DIV style="margin: 0cm 0cm 10pt;"><strong>Client:</strong></DIV><DIV style="margin: 0cm 0cm 10pt;"><PRE style="font-family: c&#111;nsolas;"><SPAN style="color: blue;">void</SPAN>&nbsp;GotData(<SPAN>InvokeServerMethodOperation</SPAN>&nbsp;e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN>EntityCacheState</SPAN>&nbsp;ecs&nbsp;=&nbsp;(<SPAN>EntityCacheState</SPAN>)e.Result;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ecs.Merge(mgr,&nbsp;<SPAN style="color: blue;">new</SPAN>&nbsp;<SPAN>RestoreStrategy</SPAN>(<SPAN style="color: blue;">false</SPAN>,&nbsp;<SPAN style="color: blue;">false</SPAN>,&nbsp;<SPAN>MergeStrategy</SPAN>.OverwriteChanges));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</PRE></DIV><DIV style="margin: 0cm 0cm 10pt;">&nbsp;</DIV><DIV style="margin: 0cm 0cm 10pt;"><strong>Server:</strong></DIV><DIV style="margin: 0cm 0cm 10pt;"><PRE style="font-family: c&#111;nsolas;">&nbsp;&#091;<SPAN>AllowRpc</SPAN>&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="color: blue;">public</SPAN>&nbsp;<SPAN style="color: blue;">static</SPAN>&nbsp;<SPAN style="color: blue;">object</SPAN>&nbsp;AlterarDados(<SPAN>IPrincipal</SPAN>&nbsp;principal,&nbsp;<SPAN>EntityManager</SPAN>&nbsp;mgr,&nbsp;<SPAN style="color: blue;">params</SPAN>&nbsp;<SPAN>Object</SPAN>&#091;&#093;&nbsp;args)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="color: blue;">if</SPAN>&nbsp;(args&nbsp;==&nbsp;<SPAN style="color: blue;">null</SPAN>&nbsp;&amp;&nbsp;args.Length&nbsp;==&nbsp;0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="color: blue;">return</SPAN>&nbsp;<SPAN style="color: blue;">null</SPAN>;<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN>AdventureWorksEntities</SPAN>&nbsp;em&nbsp;=&nbsp;(<SPAN>AdventureWorksEntities</SPAN>)mgr;<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN>SalesOrderHeader</SPAN>&nbsp;order&nbsp;=&nbsp;args&#091;0&#093;&nbsp;<SPAN style="color: blue;">as</SPAN>&nbsp;<SPAN>SalesOrderHeader</SPAN>;<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;em.AttachEntity(order);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;order.CustomerID&nbsp;=&nbsp;118;<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN>EntityCacheState</SPAN>&nbsp;ecs&nbsp;=&nbsp;em.CacheStateManager.GetCacheState();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="color: blue;">return</SPAN>&nbsp;ecs;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</PRE></DIV><DIV style="margin: 0cm 0cm 10pt;">&nbsp;<DIV>Regards,</DIV><DIV>Sérgio Magalhães</DIV></DIV><DIV style="margin: 0cm 0cm 10pt;">&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by antonio_sergio - 25-Oct-2010 at 1:49am</span>]]>
   </description>
   <pubDate>Mon, 25 Oct 2010 01:46:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8903#8903</guid>
  </item> 
  <item>
   <title>Entity And Remote Service Method Call : Hi Sergio,   You are passing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8890#8890</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> 2253<br /><strong>Posted:</strong> 22-Oct-2010 at 4:01pm<br /><br />Hi Sergio, <DIV>&nbsp;</DIV><DIV>You are passing a SalesOrderHeader with entity state Unchanged. However, in the server, this SalesOrderHeader is not attached to any entity manager.</DIV><DIV>&nbsp;</DIV><DIV>You need to attach to an entity manager in the server, or remove it from the entity manager in the client before (i.e. setting its EntityState to Detached).</DIV><DIV>If you want to save the changes to the datasource after modifying the entity, you should take the first approach:</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp; &#091;</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>AllowRpc</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&#093;</DIV><DIV><DIV></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; public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </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>static</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </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>object</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> AlterarDados(</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>IPrincipal</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> principal, </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>EntityManager</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> mgr, </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>params</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>Object</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&#091;&#093; args) {</DIV><DIV></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; if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (args == </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>null</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> &amp; args.Length == 0) {</DIV><DIV></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;&nbsp;&nbsp; return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </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>null</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp;&nbsp;&nbsp; }</DIV><DIV></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>&nbsp;&nbsp;&nbsp;&nbsp;NorthwindIBModelManager</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> em = (</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>NorthwindIBModelManager</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>)mgr;</DIV><DIV></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>&nbsp;&nbsp;&nbsp;&nbsp;SalesOrderHeader</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> order = args&#091;0&#093; </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>SalesOrderHeader</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</DIV><DIV>&nbsp;&nbsp;&nbsp; mgr.AttachEntity(order);</DIV><DIV>&nbsp;&nbsp;&nbsp; order.CustomerID = 117;</DIV><DIV>&nbsp;&nbsp;&nbsp; mgr.SaveChanges();</DIV><DIV></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; return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> order;</DIV><DIV>&nbsp; }</DIV><DIV>&nbsp;</DIV><DIV></FONT></FONT>&nbsp;</DIV></DIV><DIV>otherwhise, you need to remove it from the entity manager in the client (i.e. setting its EntityState to Detached) before calling InvokeServeMethod. You could also create a clone of the entity (which will have EntityState Detached):</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas></FONT></FONT>&nbsp;</DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><DIV><DIV></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;public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </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>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> btAlterar_Click() {</DIV><DIV></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;string</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> typeName = </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"DomainModel.RemoteServiceMethods, DomainModel"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; </DIV><DIV></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;string</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> methodName = </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"AlterarDados"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; </DIV><DIV></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>&nbsp;&nbsp;Guid</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> myInvokeGuid = System.</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>Guid</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.NewGuid();</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp;&nbsp;mgr.RemoveEntity(MySalesOrderHeader);</DIV><DIV>&nbsp;&nbsp;DoAsyncAction(() =&gt; { mgr.InvokeServerMethodAsync(typeName, methodName, GotData, myInvokeGuid, MySalerOrderHeader); });</DIV></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><DIV>&nbsp;} </DIV><DIV><SPAN style="COLOR: blue"><FONT color=#000000></FONT></SPAN>&nbsp;</DIV><DIV><SPAN style="COLOR: blue"><FONT color=#000000>#######################################################</FONT></SPAN></DIV><DIV><SPAN style="COLOR: blue"><FONT color=#000000></FONT></SPAN>&nbsp;</DIV><DIV><SPAN style="COLOR: blue"><FONT color=#000000><DIV><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>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </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>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> btAlterar_Click() {</DIV><DIV></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; string</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> typeName = </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"DomainModel.RemoteServiceMethods, DomainModel"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; </DIV><DIV></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; string</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> methodName = </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"AlterarDados"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; </DIV><DIV></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>&nbsp; Guid</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> myInvokeGuid = System.</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>Guid</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.NewGuid();</FONT></FONT></DIV><DIV>&nbsp; <FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><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>SalesOrderHeader</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> newSalerOrderHeader = (</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>SalesOrderHeader</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>ICloneable</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>)MySalerOrderHeader).Clone();</DIV><DIV></FONT></FONT>&nbsp; DoAsyncAction(() =&gt; { mgr.InvokeServerMethodAsync(typeName, methodName, GotData, myInvokeGuid, newSalerOrderHeader);});</DIV></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><DIV>} </DIV></FONT></FONT></FONT></SPAN></DIV><DIV><SPAN style="COLOR: blue"><FONT color=#000000></FONT></SPAN>&nbsp;</DIV></FONT></FONT></DIV><DIV>&nbsp;</DIV><DIV>What exactly are you trying to accomplish? So I can better advise you...</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>&nbsp;&nbsp; Silvio.</DIV>]]>
   </description>
   <pubDate>Fri, 22 Oct 2010 16:01:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8890#8890</guid>
  </item> 
  <item>
   <title>Entity And Remote Service Method Call : Hello everyone, I&amp;#039;m starting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8884#8884</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=979" rel="nofollow">antonio_sergio</a><br /><strong>Subject:</strong> 2253<br /><strong>Posted:</strong> 22-Oct-2010 at 1:56am<br /><br />Hello everyone,<DIV>I'm starting to give the first steps with DevForce and found a difficulty.</DIV><DIV>When I try to chage my Entity in the server give me an error in the property I'm trying to change.</DIV><DIV>&nbsp;</DIV><DIV>What am I dong wrong???????????</DIV><DIV>&nbsp;</DIV><DIV>Client:</DIV><DIV><PRE style="FONT-FAMILY: c&#111;nsolas"><SPAN style="COLOR: blue"><FONT color=#000000>        </FONT>private</SPAN>&nbsp;<SPAN style="COLOR: blue">void</SPAN>&nbsp;btAlterar_Click(<SPAN style="COLOR: blue">object</SPAN>&nbsp;sender,&nbsp;System.Windows.<SPAN style="COLOR: #2b91af">RoutedEventArgs</SPAN>&nbsp;e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">string</SPAN>&nbsp;typeName&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"MasterDetailsWeb.SalesServiceProvider,&nbsp;MasterDetailsWeb"</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">string</SPAN>&nbsp;methodName&nbsp;=&nbsp;<SPAN style="COLOR: #a31515">"AlterarDados"</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">Guid</SPAN>&nbsp;myInvokeGuid&nbsp;=&nbsp;System.<SPAN style="COLOR: #2b91af">Guid</SPAN>.NewGuid();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mgr.InvokeServerMethodAsync(typeName,&nbsp;methodName,&nbsp;GotData,&nbsp;myInvokeGuid,&nbsp;MySalesOrderHeader);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">void</SPAN>&nbsp;GotData(<SPAN style="COLOR: #2b91af">InvokeServerMethodOperation</SPAN>&nbsp;e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MySalesOrderHeader&nbsp;=&nbsp;e.Result&nbsp;<SPAN style="COLOR: blue">as</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">SalesOrderHeader</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</PRE></DIV><DIV>&nbsp;</DIV><DIV>Property:</DIV><DIV>&nbsp;</DIV><DIV><PRE style="FONT-FAMILY: c&#111;nsolas"><SPAN style="COLOR: blue">    #region</SPAN>&nbsp;CustomerID&nbsp;property<BR> <BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: gray">///</SPAN><SPAN style="COLOR: green">&nbsp;</SPAN><SPAN style="COLOR: gray">&lt;summary&gt;</SPAN><SPAN style="COLOR: green">Gets&nbsp;or&nbsp;sets&nbsp;the&nbsp;CustomerID.&nbsp;</SPAN><SPAN style="COLOR: gray">&lt;/summary&gt;</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;&#091;<SPAN style="COLOR: #2b91af">Bindable</SPAN>(<SPAN style="COLOR: blue">true</SPAN>,&nbsp;<SPAN style="COLOR: #2b91af">BindingDirection</SPAN>.TwoWay)&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&#091;<SPAN style="COLOR: #2b91af">Editable</SPAN>(<SPAN style="COLOR: blue">true</SPAN>)&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&#091;<SPAN style="COLOR: #2b91af">Display</SPAN>(Name=<SPAN style="COLOR: #a31515">"CustomerID"</SPAN>,&nbsp;AutoGenerateField=<SPAN style="COLOR: blue">true</SPAN>)&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&#091;IbVal.<SPAN style="COLOR: #2b91af">RequiredValueVerifier</SPAN>(&nbsp;ErrorMessageResourceName=<SPAN style="COLOR: #a31515">"SalesOrderHeader_CustomerID"</SPAN>)&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&#091;<SPAN style="COLOR: #2b91af">DataMember</SPAN>&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;<SPAN style="COLOR: blue">int</SPAN>&nbsp;CustomerID&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">get</SPAN>&nbsp;{&nbsp;<SPAN style="COLOR: blue">return</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">PropertyMetadata</SPAN>.CustomerID.GetValue(<SPAN style="COLOR: blue">this</SPAN>);&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">set</SPAN>&nbsp;{&nbsp;<SPAN style="COLOR: #2b91af">PropertyMetadata</SPAN>.CustomerID.SetValue(<SPAN style="COLOR: blue">this</SPAN>,&nbsp;<SPAN style="COLOR: blue">value</SPAN>);&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR><SPAN style="COLOR: blue">&nbsp;&nbsp;&nbsp;&nbsp;#endregion</SPAN>&nbsp;CustomerID&nbsp;property</PRE></DIV><DIV>&nbsp;</DIV><DIV>Server:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;<SPAN style="COLOR: #2b91af">AllowRpc</SPAN>&#093;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;<SPAN style="COLOR: blue">static</SPAN>&nbsp;<SPAN style="COLOR: blue">object</SPAN>&nbsp;AlterarDados(<SPAN style="COLOR: #2b91af">IPrincipal</SPAN>&nbsp;principal,&nbsp;<SPAN style="COLOR: #2b91af">EntityManager</SPAN>&nbsp;mgr,&nbsp;<SPAN style="COLOR: blue">params</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">Object</SPAN>&#091;&#093;&nbsp;args)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">if</SPAN>&nbsp;(args&nbsp;==&nbsp;<SPAN style="COLOR: blue">null</SPAN>&nbsp;&amp;&nbsp;args.Length&nbsp;==&nbsp;0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">return</SPAN>&nbsp;<SPAN style="COLOR: blue">null</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: #2b91af">SalesOrderHeader</SPAN>&nbsp;order&nbsp;=&nbsp;args&#091;0&#093;&nbsp;<SPAN style="COLOR: blue">as</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">SalesOrderHeader</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;order.CustomerID&nbsp;=&nbsp;117;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">return</SPAN>&nbsp;order;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Error:</DIV><DIV>&nbsp;</DIV><DIV><img src="http://www.ideablade.com/forum/uploads/979/Error1.jpg" height="379" width="694" border="0" /></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Sorry for my English :))))</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>Sérgio Magalhães</DIV>]]>
   </description>
   <pubDate>Fri, 22 Oct 2010 01:56:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2253&amp;PID=8884#8884</guid>
  </item> 
 </channel>
</rss>