<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>EF: Working with the context cache</title><link>http://msmvps.com/blogs/matthieu/archive/2009/04/07/ef-working-with-the-context-cache.aspx</link><description>When we want to work with ObjectContext cache, we have to use the ObjectStateManager with its boring syntax. products = context.ObjectStateManager.GetObjectStateEntries( EntityState .Added | EntityState .Modified | EntityState .Unchanged).Select(ose </description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: EF: Working with the context cache</title><link>http://msmvps.com/blogs/matthieu/archive/2009/04/07/ef-working-with-the-context-cache.aspx#1685734</link><pubDate>Wed, 08 Apr 2009 01:04:56 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1685734</guid><dc:creator>Julie Lerman</dc:creator><description>&lt;p&gt;Hey Matthieu&lt;/p&gt;
&lt;p&gt;I feel the same way about typing those over and over. What I did instead was just create overrides so that I can continue to call GetObjectStateEntries.&lt;/p&gt;
&lt;p&gt;One override takes 0 arguments - that returns all states.&lt;/p&gt;
&lt;p&gt;Another takes the entity state enum arguments plus a generic type, which like yours, queries for entries whose entity is of the requested type and the requested entity state(s).&lt;/p&gt;
&lt;p&gt;Another takes NO entity state enum arguments and the generic type. That gives back all entries of the type, regardless of the state.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve got them in my book, but I should probably share them on the blog as well. :-)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1685734" width="1" height="1"&gt;</description></item></channel></rss>