<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Hot Off the Presses: SOA Data Access!</title>
	<atom:link href="http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/</link>
	<description>A glimpse into the lives of Tony &#38; Zuzana Sneed</description>
	<lastBuildDate>Thu, 12 Aug 2010 15:59:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Bob Bedell</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-114</link>
		<dc:creator>Bob Bedell</dc:creator>
		<pubDate>Tue, 06 Oct 2009 22:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-114</guid>
		<description>Hi Tony,

I went off on a WCF tangent, but am back on EF tonight and will spend some time with you code ASAP.

Thanks for the resources. Looking forward to the POCO article.

Bob</description>
		<content:encoded><![CDATA[<p>Hi Tony,</p>
<p>I went off on a WCF tangent, but am back on EF tonight and will spend some time with you code ASAP.</p>
<p>Thanks for the resources. Looking forward to the POCO article.</p>
<p>Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-113</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Sun, 27 Sep 2009 10:33:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-113</guid>
		<description>Sorry that I neglected t update the article code :(, but I&#039;ve been busy wrapping my arms around EF 4.0, and seeing as it hopefully won&#039;t be too long before its release, I figured it would be better to write an article on doing n-tier with EF 4.0, which supports POCO&#039;s out of the box with self-tracking entities (see my DevelopMentor newsletter article at http://www.develop.com/entityframework4).

That said, you&#039;ll be glad to know I wrote a sample app in EF 3.5 that does exactly what you&#039;re asking about: http://is.gd/42QlK.
In here you&#039;ll see that you set the Reference propery&#039;s EntityKey in the Create and Update methods of your service.  This is necessary in order to relate a new or updated Product with a particular category.  As you can see, it is quite clumsy and will no longer be necessary in EF 4.0.  But that&#039;s how you do it for now.
Cheers!</description>
		<content:encoded><![CDATA[<p>Sorry that I neglected t update the article code <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> , but I&#8217;ve been busy wrapping my arms around EF 4.0, and seeing as it hopefully won&#8217;t be too long before its release, I figured it would be better to write an article on doing n-tier with EF 4.0, which supports POCO&#8217;s out of the box with self-tracking entities (see my DevelopMentor newsletter article at <a href="http://www.develop.com/entityframework4)" rel="nofollow">http://www.develop.com/entityframework4)</a>.</p>
<p>That said, you&#8217;ll be glad to know I wrote a sample app in EF 3.5 that does exactly what you&#8217;re asking about: <a href="http://is.gd/42QlK" rel="nofollow">http://is.gd/42QlK</a>.<br />
In here you&#8217;ll see that you set the Reference propery&#8217;s EntityKey in the Create and Update methods of your service.  This is necessary in order to relate a new or updated Product with a particular category.  As you can see, it is quite clumsy and will no longer be necessary in EF 4.0.  But that&#8217;s how you do it for now.<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Bedell</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-112</link>
		<dc:creator>Bob Bedell</dc:creator>
		<pubDate>Fri, 25 Sep 2009 23:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-112</guid>
		<description>Hi Tony,

was revisitng your app, doing some work with WCF. Where would you do this?

&quot;The proper way to go about it is to set the EntityKey property of the Order’s CustomerReference property, like so:

order.CustomerReference.EntityKey = new EntityKey
(”NorthwindEntities.CustomerSet”, “CustomerID”, od.CustomerID);&quot;

Appreciate it if you have a moment to respond, though I certainly also understand if its been a while since you revisited this.

Bob</description>
		<content:encoded><![CDATA[<p>Hi Tony,</p>
<p>was revisitng your app, doing some work with WCF. Where would you do this?</p>
<p>&#8220;The proper way to go about it is to set the EntityKey property of the Order’s CustomerReference property, like so:</p>
<p>order.CustomerReference.EntityKey = new EntityKey<br />
(”NorthwindEntities.CustomerSet”, “CustomerID”, od.CustomerID);&#8221;</p>
<p>Appreciate it if you have a moment to respond, though I certainly also understand if its been a while since you revisited this.</p>
<p>Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-111</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Sat, 07 Feb 2009 13:43:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-111</guid>
		<description>Hello Bob,

Thanks for finding that typo ... don&#039;t know how we missed that one! :)

The way I&#039;ve configured the service reference in each client is to use the change tracking collection for ALL lists.  If you have classes that you&#039;re not updating (such as Customer and Product) you can configure the service reference to return List instead and then convert it to the ChangeTrackingCollection (or ChangeTrackngList) only for the items you want to track changes on.

In terms of performance, the initial slow fetch is most likely due to WCF setting up the communication channel.  The performance impact of event notifications is negligibl because .NET events are fired only if there are one or more handlers.

I&#039;m happy the sample app is helpful to folks wanting to use LINQ in n-tier apps.  I have learned quite a bit about Entity Framework since writing the article, and I plan to incorporate those lessons in a future version of the sample app (coming in the next couple of weeks!).

Cheers,
Tony</description>
		<content:encoded><![CDATA[<p>Hello Bob,</p>
<p>Thanks for finding that typo &#8230; don&#8217;t know how we missed that one! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The way I&#8217;ve configured the service reference in each client is to use the change tracking collection for ALL lists.  If you have classes that you&#8217;re not updating (such as Customer and Product) you can configure the service reference to return List instead and then convert it to the ChangeTrackingCollection (or ChangeTrackngList) only for the items you want to track changes on.</p>
<p>In terms of performance, the initial slow fetch is most likely due to WCF setting up the communication channel.  The performance impact of event notifications is negligibl because .NET events are fired only if there are one or more handlers.</p>
<p>I&#8217;m happy the sample app is helpful to folks wanting to use LINQ in n-tier apps.  I have learned quite a bit about Entity Framework since writing the article, and I plan to incorporate those lessons in a future version of the sample app (coming in the next couple of weeks!).</p>
<p>Cheers,<br />
Tony</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Bedell</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-110</link>
		<dc:creator>Bob Bedell</dc:creator>
		<pubDate>Thu, 05 Feb 2009 21:02:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-110</guid>
		<description>Then again, as far as supressing event notifications goes, it occurs to me that you do provide a Tracking property. I&#039;ll play around a bit with toggling it at some point in the fetch sequence. Thats probably how RaiseListChangedEvents change is implemented anyway.</description>
		<content:encoded><![CDATA[<p>Then again, as far as supressing event notifications goes, it occurs to me that you do provide a Tracking property. I&#8217;ll play around a bit with toggling it at some point in the fetch sequence. Thats probably how RaiseListChangedEvents change is implemented anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Bedell</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-109</link>
		<dc:creator>Bob Bedell</dc:creator>
		<pubDate>Thu, 05 Feb 2009 03:20:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-109</guid>
		<description>I should say that the initial fetch is SLOW. Subsequent fetches are considerably faster. Is some sort of initial request compilation going on in the way ASP.NET pages are compiled on first request? Looking forward to the revised version, too!!</description>
		<content:encoded><![CDATA[<p>I should say that the initial fetch is SLOW. Subsequent fetches are considerably faster. Is some sort of initial request compilation going on in the way ASP.NET pages are compiled on first request? Looking forward to the revised version, too!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Bedell</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-108</link>
		<dc:creator>Bob Bedell</dc:creator>
		<pubDate>Thu, 05 Feb 2009 02:32:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-108</guid>
		<description>Hi again Tony,

I LOVE this app. Here it is a month latter and I&#039;m still playing with it in a variety of incarnations pretty much daily (along with the new CSLA 3.6). Thank you for making it so comprehensive, i.e. all the CRUD operations, 1:M and M:M relationships, etc. Most &quot;sample&quot; apps don&#039;t go to the lengths you have. Thanks for covering ALL the bases for once in a digestable app.

Wanted to point out one critical typo in the EntityDataProvider&#039;s UpdateOrder method. When you build your list of new OrderDetails to be inserted, you have:

 List insertedDetails =
                    (from od in order.OrderDetails
                     where od.TrackingState == TrackingInfo.Updated
                     select od).ToList();

TrackingInfo.Updated should be TrackingInfo.Created (As it stands you&#039;ll get duplicate primary key violations).

Sure would be nice to be able to toggle off PropertyChanged and ListChanged notifications when simply fetching data, wouldn&#039;t it. Nice thing about the WinForms version is that BindingList has a RaiseListChangedEvents property that at least allows you to toggle off list changed events. I havn&#039;t stumbled across a WPF counterpart yet though. Fetching is SLOW, and I suspect supressing all the event notifications would be a major performance enhancement.

Thanks again. Back at it tomorrow probably.

Bob</description>
		<content:encoded><![CDATA[<p>Hi again Tony,</p>
<p>I LOVE this app. Here it is a month latter and I&#8217;m still playing with it in a variety of incarnations pretty much daily (along with the new CSLA 3.6). Thank you for making it so comprehensive, i.e. all the CRUD operations, 1:M and M:M relationships, etc. Most &#8220;sample&#8221; apps don&#8217;t go to the lengths you have. Thanks for covering ALL the bases for once in a digestable app.</p>
<p>Wanted to point out one critical typo in the EntityDataProvider&#8217;s UpdateOrder method. When you build your list of new OrderDetails to be inserted, you have:</p>
<p> List insertedDetails =<br />
                    (from od in order.OrderDetails<br />
                     where od.TrackingState == TrackingInfo.Updated<br />
                     select od).ToList();</p>
<p>TrackingInfo.Updated should be TrackingInfo.Created (As it stands you&#8217;ll get duplicate primary key violations).</p>
<p>Sure would be nice to be able to toggle off PropertyChanged and ListChanged notifications when simply fetching data, wouldn&#8217;t it. Nice thing about the WinForms version is that BindingList has a RaiseListChangedEvents property that at least allows you to toggle off list changed events. I havn&#8217;t stumbled across a WPF counterpart yet though. Fetching is SLOW, and I suspect supressing all the event notifications would be a major performance enhancement.</p>
<p>Thanks again. Back at it tomorrow probably.</p>
<p>Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-107</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 27 Jan 2009 21:02:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-107</guid>
		<description>Tony,
Thanks for the explanation &amp; thanks once again for the excellent article - will watch out for the new version.
Kind Regds</description>
		<content:encoded><![CDATA[<p>Tony,<br />
Thanks for the explanation &amp; thanks once again for the excellent article &#8211; will watch out for the new version.<br />
Kind Regds</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-106</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Tue, 27 Jan 2009 12:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-106</guid>
		<description>Hello Mark,

Ah yes, you&#039;ve discovered the missing relationship!  What I did was to run the EF wizard but deselect the Customers table.  Then right-click on the diagram, select &quot;Update Model from Database&quot; and select the Customers table, removing the association between Customer and Order in the diagram.  The end result is that the Order entity contains the CustomerID foreign key, making it much easier to update the Customer of an Order simply by setting the CustomerID property.

The reason I went to all that trouble was that, at the time, I did not know how to update an Order&#039;s Customer property in a disconnected fashion.  The proper way to go about it is to set the EntityKey property of the Order&#039;s CustomerReference property, like so:

order.CustomerReference.EntityKey = new EntityKey
    (&quot;NorthwindEntities.CustomerSet&quot;, &quot;CustomerID&quot;, od.CustomerID);

I will shortly post a new version of the article sample app which contains this and other improvements.</description>
		<content:encoded><![CDATA[<p>Hello Mark,</p>
<p>Ah yes, you&#8217;ve discovered the missing relationship!  What I did was to run the EF wizard but deselect the Customers table.  Then right-click on the diagram, select &#8220;Update Model from Database&#8221; and select the Customers table, removing the association between Customer and Order in the diagram.  The end result is that the Order entity contains the CustomerID foreign key, making it much easier to update the Customer of an Order simply by setting the CustomerID property.</p>
<p>The reason I went to all that trouble was that, at the time, I did not know how to update an Order&#8217;s Customer property in a disconnected fashion.  The proper way to go about it is to set the EntityKey property of the Order&#8217;s CustomerReference property, like so:</p>
<p>order.CustomerReference.EntityKey = new EntityKey<br />
    (&#8220;NorthwindEntities.CustomerSet&#8221;, &#8220;CustomerID&#8221;, od.CustomerID);</p>
<p>I will shortly post a new version of the article sample app which contains this and other improvements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://blog.tonysneed.com/2008/12/04/hot-off-the-presses-soa-data-access/#comment-105</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 27 Jan 2009 01:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=133#comment-105</guid>
		<description>Thanks for the great article! We very much like your SOA approach to EF. While reviewing the sample code I was puzzled why you appear to have deleted the SQL table relationship between Orders and Customers table. I have managed to get your sample app working but have been unable to recreate a similiar app using the same database and tables. The Entity Framework EDM wizard automatically creates a relationship between these tables whereas the EDM accompanying your sample code does not contain this relationship which has a significant impact throughout your sample code. Could you please explain why you took this approach rather than using the wizard generated EF EDM.</description>
		<content:encoded><![CDATA[<p>Thanks for the great article! We very much like your SOA approach to EF. While reviewing the sample code I was puzzled why you appear to have deleted the SQL table relationship between Orders and Customers table. I have managed to get your sample app working but have been unable to recreate a similiar app using the same database and tables. The Entity Framework EDM wizard automatically creates a relationship between these tables whereas the EDM accompanying your sample code does not contain this relationship which has a significant impact throughout your sample code. Could you please explain why you took this approach rather than using the wizard generated EF EDM.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
