<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tip 24 – How to get the ObjectContext from an Entity</title><link>http://blogs.msdn.com/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx</link><description>Customers often ask how to get from an Entity back to the ObjectContext . Now generally we don’t recommend trying this. But sometimes you really need a way to get to the ObjectContext . For example if you are in method and all you have is the Entity,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Meta-Me : Entity Framework Tips</title><link>http://blogs.msdn.com/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx#9709062</link><pubDate>Mon, 08 Jun 2009 21:44:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9709062</guid><dc:creator>Meta-Me : Entity Framework Tips</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/alexj/archive/2009/03/26/index-of-tips.aspx"&gt;http://blogs.msdn.com/alexj/archive/2009/03/26/index-of-tips.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Tip 24 – How to get the ObjectContext from an Entity</title><link>http://blogs.msdn.com/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx#9727816</link><pubDate>Fri, 12 Jun 2009 00:11:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9727816</guid><dc:creator>Bingo</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Will the next release (.NET 4??) of Entity Framework provide this in a more fundamental fashion.&lt;/p&gt;
&lt;p&gt;Maybe as a property like EntityObject.ObjectContext?&lt;/p&gt;</description></item><item><title>re: Tip 24 – How to get the ObjectContext from an Entity</title><link>http://blogs.msdn.com/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx#9727849</link><pubDate>Fri, 12 Jun 2009 00:23:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9727849</guid><dc:creator>AlexJ</dc:creator><description>&lt;p&gt;Bingo&lt;/p&gt;
&lt;p&gt;We are thinking about adding something, probably a static method on ObjectContext&lt;/p&gt;
&lt;p&gt;i.e. &lt;/p&gt;
&lt;p&gt;ObjectContext context = ObjectContext.GetContext(entity);&lt;/p&gt;
&lt;p&gt;But we need to weigh that up against a lot of other competing ideas, so it might not make it.&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;
</description></item><item><title>re: Tip 24 – How to get the ObjectContext from an Entity</title><link>http://blogs.msdn.com/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx#9894361</link><pubDate>Fri, 11 Sep 2009 22:56:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9894361</guid><dc:creator>AlexY</dc:creator><description>&lt;p&gt;Thanks a lot for your tips.&lt;/p&gt;
&lt;p&gt;I realy enjoy your blog.&lt;/p&gt;
&lt;p&gt;Easy Peasy is not not sometimes easy ;-)&lt;/p&gt;</description></item><item><title>re: Tip 24 – How to get the ObjectContext from an Entity</title><link>http://blogs.msdn.com/alexj/archive/2009/06/08/tip-24-how-to-get-the-objectcontext-from-an-entity.aspx#9941718</link><pubDate>Mon, 28 Dec 2009 21:15:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9941718</guid><dc:creator>Manoj</dc:creator><description>&lt;p&gt;A related issue is that once an entity is detached from context, it loses all the relationship. This is due to the fact that the relationships are tightly coupled to EF. Hopefully EF2 addresses this in a more POCO-friendly fashion.&lt;/p&gt;</description></item></channel></rss>