<?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 : Help with Entities</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Help with Entities</description>
  <pubDate>Sun, 12 Apr 2026 17:33:04 -700</pubDate>
  <lastBuildDate>Mon, 10 Jan 2011 15:20:47 -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=2426</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>Help with Entities : The first approach doesn&amp;#039;t...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2426&amp;PID=9613#9613</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> 2426<br /><strong>Posted:</strong> 10-Jan-2011 at 3:20pm<br /><br />The first approach doesn't work since it's a mix of POCO and EF.&nbsp; Because the entities were defined in the EDM DevForce is treating them as EF entities and not taking the POCO processing path which would call your FetchLocations query method.&nbsp; You can work around this by creating a custom EntityServerQueryInterceptor, but it may not be a very robust solution.&nbsp; The interceptor would need to override the standard ExecuteQuery logic to explicitly call your fetch method, and then force the result.&nbsp; Something like this:&nbsp;<DIV></DIV><P>&nbsp; public class QueryInterceptor : EntityServerQueryInterceptor {</P><P>&nbsp;&nbsp;&nbsp; protected override bool ExecuteQuery() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PocoServiceProvider provider = new PocoServiceProvider();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var list = provider.FetchLocations();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ForceResult(list);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }</P><DIV></DIV>If you support create/update/delete then you'd also need a custom EntityServerSaveInterceptor to override default save logic.<DIV>&nbsp;</DIV><DIV>Your second approach, using the RPC method, should work as long as the entities are also defined on the Silverlight client, which they will be if&nbsp; the *Ib.Designer.cs file is added as a link.&nbsp; </DIV>]]>
   </description>
   <pubDate>Mon, 10 Jan 2011 15:20:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2426&amp;PID=9613#9613</guid>
  </item> 
  <item>
   <title>Help with Entities : HiWe&amp;#039;re evaluating how we...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2426&amp;PID=9587#9587</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=907" rel="nofollow">rgillingham</a><br /><strong>Subject:</strong> 2426<br /><strong>Posted:</strong> 07-Jan-2011 at 6:42am<br /><br />Hi<br><br>We're evaluating how we can use/benefit from DevForce with PostgreSQL - and we have dot connect for Postgres from DevArt<br><br>We have a lot of stored procedures in our database and if we try to import these EF complains that they are composable and cannot be imported.&nbsp; Ok - shame.<br><br>So we thought why not use use ADO.net to get the stored procedure resultset and then manuall marshal this into DevForce entities.<br><br>If we create a blank mode and add a DevForce entity into it with some properties then we should be able to do something like this on the server<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;Query&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public IEnumerable&lt;LocationEntity&gt; FetchLocations()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;LocationEntity&gt; locations = new List&lt;LocationEntity&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var location = new LocationEntity();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location.location_short_id = "123";<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; locations.Add(location);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEnumerable&lt;LocationEntity&gt; result = locations;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return result;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>and call it with this from the Silverlight client<br><br>extend the domain model<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static EntityQuery&lt;LocationEntity&gt; Locations(this EntityManager em)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new EntityQuery&lt;LocationEntity&gt;("FetchLocations", em);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>then call in with <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void GetLocations()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var eq = EntityManager.DefaultManager.Locations();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq.ExecuteAsync((r) =&gt; OnLocations(r) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>If I do this though I get an unhandled exception in the silverlight client of<br><br>"...No mapping specified for instances of the EntitySet and AssociationSet in the EntityContainer"<br><br>So I guess where I'm coming from is - how can we use the EntityFramework model to define entity shapes but then manually move them around between the tiers.&nbsp; I know we can use the POCO pattern but this then becomes a mission for adding in verifiers etc.<br><br>Another approach I tried was <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;AllowRpc&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static Object GetLocations(IPrincipal pPrincipal, EntityManager pPm, params Object&#091;&#093; pArgs)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; List&lt;LocationEntity&gt; locations = new List&lt;LocationEntity&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var location = pPm.CreateEntity&lt;LocationEntity&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location.location_short_id = "123";<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; locations.Add(location);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEnumerable&lt;LocationEntity&gt; result = locations;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return result;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>But this complained that the result was not serializable.<br><br>Any help and guidance welcomed.<br><br>Richard<br><br><br><br>]]>
   </description>
   <pubDate>Fri, 07 Jan 2011 06:42:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2426&amp;PID=9587#9587</guid>
  </item> 
 </channel>
</rss>