<?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: Better N-Tier Concurrency Management for the Entity Framework</title>
	<atom:link href="http://blog.tonysneed.com/2008/11/08/better-n-tier-concurrency-management-for-the-entity-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tonysneed.com/2008/11/08/better-n-tier-concurrency-management-for-the-entity-framework/</link>
	<description>A glimpse into the lives of Tony &#38; Zuzana Sneed</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:30:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Tony Sneed</title>
		<link>http://blog.tonysneed.com/2008/11/08/better-n-tier-concurrency-management-for-the-entity-framework/#comment-1074</link>
		<dc:creator><![CDATA[Tony Sneed]]></dc:creator>
		<pubDate>Sun, 22 Jan 2012 17:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=120#comment-1074</guid>
		<description><![CDATA[Hi Chris,

Be advised this posting and article came out prior to the second version of Entity Framework that shipped with .NET 4.0 and Visual Studio 2010.  If you are using POCO classes (Plain Old CLR Objects), then you don&#039;t need to copy values from one object to another, because you are using only one set of classes.

Cheers,
Tony]]></description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Be advised this posting and article came out prior to the second version of Entity Framework that shipped with .NET 4.0 and Visual Studio 2010.  If you are using POCO classes (Plain Old CLR Objects), then you don&#8217;t need to copy values from one object to another, because you are using only one set of classes.</p>
<p>Cheers,<br />
Tony</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://blog.tonysneed.com/2008/11/08/better-n-tier-concurrency-management-for-the-entity-framework/#comment-1073</link>
		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Fri, 20 Jan 2012 16:22:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=120#comment-1073</guid>
		<description><![CDATA[Hi Tony,
I enjoyed the article and was able to use in my own solution.  However, in your extension method &quot;CreateEntityFromObject&quot;  you&#039;re using some reflection to assign values from the business object to the EF data object.  Our database uses a different naming convention than does our application development(and using reflection would require having the properties be the same).  I&#039;d like to avoid having database naming conventions in the application code, so I took apart your extension method and tried to hack it into the method itself:

using (SQL context = new SQL(_conn))
{
  // this works but uses reflection
  //Work updatedWork = context.CreateEntityFromObject(&quot;Works&quot;, this);

  Work updatedWork = new Work();
  updatedWork.Id = Id;  // P/K
  updatedWork.UserIdAssignTo = UserIdAssignTo;
  updatedWork.RowVer = Version;  // for optimistic concurrency

  Work.EntityKey = context.CreateEntityKey(&quot;Works&quot;, updatedWork);
  // getting error on line above, the red under line is under Work.EntityKey
  context.AttachAsModified(updatedWork);

  try { context.SaveChanges(); }
  catch (OptimisticConcurrencyException ex) { }
}

The line: Work.EntityKey = context.CreateEntityKey(&quot;Works&quot;, updatedWork); is throwing the following error:
An object reference is required for the non-static field, method, or property EntityKey.get

I&#039;m a little confused as to how/why it works on yours, but not the code I wrote.  I followed the inheritance chain from &quot;Work&quot;(that&#039;s my EF object), It inherits from System.Data.Objects.DataClasses.EntityObject, and EntityObject implements the IEntityWithKey interface, with both public get/set.  So it seems I should get access to it.  Any help would be greatly appreciated.]]></description>
		<content:encoded><![CDATA[<p>Hi Tony,<br />
I enjoyed the article and was able to use in my own solution.  However, in your extension method &#8220;CreateEntityFromObject&#8221;  you&#8217;re using some reflection to assign values from the business object to the EF data object.  Our database uses a different naming convention than does our application development(and using reflection would require having the properties be the same).  I&#8217;d like to avoid having database naming conventions in the application code, so I took apart your extension method and tried to hack it into the method itself:</p>
<p>using (SQL context = new SQL(_conn))<br />
{<br />
  // this works but uses reflection<br />
  //Work updatedWork = context.CreateEntityFromObject(&#8220;Works&#8221;, this);</p>
<p>  Work updatedWork = new Work();<br />
  updatedWork.Id = Id;  // P/K<br />
  updatedWork.UserIdAssignTo = UserIdAssignTo;<br />
  updatedWork.RowVer = Version;  // for optimistic concurrency</p>
<p>  Work.EntityKey = context.CreateEntityKey(&#8220;Works&#8221;, updatedWork);<br />
  // getting error on line above, the red under line is under Work.EntityKey<br />
  context.AttachAsModified(updatedWork);</p>
<p>  try { context.SaveChanges(); }<br />
  catch (OptimisticConcurrencyException ex) { }<br />
}</p>
<p>The line: Work.EntityKey = context.CreateEntityKey(&#8220;Works&#8221;, updatedWork); is throwing the following error:<br />
An object reference is required for the non-static field, method, or property EntityKey.get</p>
<p>I&#8217;m a little confused as to how/why it works on yours, but not the code I wrote.  I followed the inheritance chain from &#8220;Work&#8221;(that&#8217;s my EF object), It inherits from System.Data.Objects.DataClasses.EntityObject, and EntityObject implements the IEntityWithKey interface, with both public get/set.  So it seems I should get access to it.  Any help would be greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://blog.tonysneed.com/2008/11/08/better-n-tier-concurrency-management-for-the-entity-framework/#comment-96</link>
		<dc:creator><![CDATA[Tony]]></dc:creator>
		<pubDate>Thu, 11 Dec 2008 13:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tonysneed.com/?p=120#comment-96</guid>
		<description><![CDATA[I have just written a blog post that describes a bug in EF v.1, which has the effect of limiting the use of the AttachAsModified method such that you are required to supply the original foreign key values:
http://blog.tonysneed.com/?p=140

If you are using a timestamp for concurrency and do not wish to retain other original values, then your only alternative is to re-query the database for the original entity. :(]]></description>
		<content:encoded><![CDATA[<p>I have just written a blog post that describes a bug in EF v.1, which has the effect of limiting the use of the AttachAsModified method such that you are required to supply the original foreign key values:<br />
<a href="http://blog.tonysneed.com/?p=140" rel="nofollow">http://blog.tonysneed.com/?p=140</a></p>
<p>If you are using a timestamp for concurrency and do not wish to retain other original values, then your only alternative is to re-query the database for the original entity. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

