<?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>Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx</link><description>The goal of this walkthrough is to demonstrate a basic scenario for the use of the Self-Tracking Entities feature of Entity Framework. Self-Tracking Entities consist on a set of code generation templates based on Text Template Transformation Toolkit (T4)</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>ADO.NET team blog : Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9799167</link><pubDate>Tue, 23 Jun 2009 13:27:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9799167</guid><dc:creator>DotNetShoutout</dc:creator><description>&lt;p&gt;Thank you for submitting this cool story - Trackback from DotNetShoutout&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9800220</link><pubDate>Wed, 24 Jun 2009 00:14:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9800220</guid><dc:creator>leftside</dc:creator><description>&lt;p&gt;Very nice walkthrough. Do you have a similar one for ASP.NET?&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9833498</link><pubDate>Tue, 14 Jul 2009 23:39:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9833498</guid><dc:creator>Steve M</dc:creator><description>&lt;p&gt;Is it safe to assume there won't be a change tracking solution that is interoperable with non-clr technologies in EF 4.0? &amp;nbsp;An example would be serializing to JSON for use with the new Ajax features in asp.net 4.0, or even when consuming these services through Java or AS3. &lt;/p&gt;
&lt;p&gt;Everything in the EF 4.0 has been really impressive thus far, but losing interoperability(one of the main advantages of using web services in the first place in my opinion) would be unfortunate.&lt;/p&gt;
&lt;p&gt;Regardless, thanks for all the updates, they're very helpful.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9843486</link><pubDate>Tue, 21 Jul 2009 18:33:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9843486</guid><dc:creator>Diego Vega</dc:creator><description>&lt;p&gt;@Steve: While we haven't attempted to provide an end to end solution in which the client runs in JavaScript or on some other platform, it is one of our design goals to keep the “public surface” &amp;nbsp;of self-tracking entities as simple as possible to enable other implementations: &lt;/p&gt;
&lt;p&gt;- On one side, the serialization payload that is produced with the classes we generate is very clean and I can imagine it would be possible to consume and produce it relatively easily from any client. &lt;/p&gt;
&lt;p&gt;- On the other side, if you want to provide your own entity types and serialization, you can think of implementing the adapter interface that the ApplyChanges method takes as the second parameter. &lt;/p&gt;
&lt;p&gt;Given the current implementation, however, if you just wanted to directly use JSON, there is a known issue with DataContract’s IsReference = true. We will keep these things in mind for our next refresh. &lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9843624</link><pubDate>Tue, 21 Jul 2009 21:24:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9843624</guid><dc:creator>Zubin</dc:creator><description>&lt;p&gt;Manfred,&lt;/p&gt;
&lt;p&gt;I noticed that you are not using WCF, all operations are happening on the server side. In this case, you must turn on ChangeTracking manually in your main() after retrieval:&lt;/p&gt;
&lt;p&gt;Category c = dao.findById(1); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.ChangeTracker.ChangeTrackingEnabled = true;&lt;/p&gt;
&lt;p&gt;Note that if your dao actually go through WCF serialization, ChangeTracking will be turned on by default.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9844764</link><pubDate>Wed, 22 Jul 2009 15:49:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9844764</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Once I move Blogging.Types.tt to BloggingEntities, I don't get generated files underneath it.&lt;/p&gt;
&lt;p&gt;It has been added as a link&lt;/p&gt;
&lt;p&gt;I've tried build and RunCustomTool. &amp;nbsp;The latter produces nothing in the output window either?? It's configured as TextTemplatingFileGenerator. &amp;nbsp;Custom Tool Namespace was blank - I made it BloggingEntities&lt;/p&gt;
&lt;p&gt;The Blogging.Context.tt in BloggingService does work&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9844956</link><pubDate>Wed, 22 Jul 2009 19:11:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9844956</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;I notice the final step version of the project (which does work) shows the generated files as linked.&lt;/p&gt;
&lt;p&gt;Back to the initial project - if I click the &amp;quot;transform all templates&amp;quot; button&lt;/p&gt;
&lt;p&gt;I get &lt;/p&gt;
&lt;p&gt;Transforming templates for all project items.&lt;/p&gt;
&lt;p&gt;-------------------------------------&lt;/p&gt;
&lt;p&gt;Transforming template Blogging.Context.tt with TextTemplatingFileGenerator ... succeeded.&lt;/p&gt;
&lt;p&gt;Transforming template Blogging.Types.tt with TextTemplatingFileGenerator ... succeeded.&lt;/p&gt;
&lt;p&gt;-------------------------------------&lt;/p&gt;
&lt;p&gt;Text templating transformation complete&lt;/p&gt;
&lt;p&gt;In fact the files have been generated (in the same directory as the corresponding tt file). They just aren't linked in for the types tt file. &amp;nbsp;I don't know why they link ok for the context tt file.&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9848459</link><pubDate>Sat, 25 Jul 2009 18:07:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9848459</guid><dc:creator>cowgaR</dc:creator><description>&lt;p&gt;I'm new to change-tracking entities, but...&lt;/p&gt;
&lt;p&gt;should I understand that we never ever get lazy-loading with change tracking entities? So everything will be eager loaded? (I think there is lazy load in LLBLGen pro)&lt;/p&gt;
&lt;p&gt;or we just don't get lazy loading in the - say - UI/Application layer, which is used for serialization to/from JSON, but once we have real object (deserialized) we can get lazy loading from our repositories, or can't we at all?&lt;/p&gt;
&lt;p&gt;my head is dizzled but I am thinking about IQueryable repositories (although it is a bit different thing) and got an idea that they would not work without lazy loading being implemented here (e.g. I want to run queries on the sql server not in a memory and I don't want to have 200 methods in my repository class).&lt;/p&gt;
&lt;p&gt;thanks for claryfing that, still thinking if there is the need to know whole object graph I am going to work with (hence UpdatePostWithComments) or there would be some improvements for developer not to think much about it (as these entities tend to be really cycled all over with another entities) as this way it is really dangerous not to think what I really need and all the time working with big object graphs.&lt;/p&gt;
&lt;p&gt;once again thanks for answer, some mvc-ajax-serializing post would be welcomed though&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9851273</link><pubDate>Tue, 28 Jul 2009 22:10:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9851273</guid><dc:creator>Ken Smith</dc:creator><description>&lt;p&gt;It looks like the process you're recommending requires the use of CLR types on the client. &amp;nbsp;How are you recommending that we use this approach with Silverlight clients? &amp;nbsp;I suppose we can implement our own tracking from scratch (as you seemed to recommend above), but that doesn't seem to be terribly efficient, and it certainly makes Silverlight a second-class citizen relative to the rest of the MS universe. &amp;nbsp;Are you planning to include self-tracking entity generation with the SLSvcInst.exe proxy generation tool?&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9852205</link><pubDate>Wed, 29 Jul 2009 18:40:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9852205</guid><dc:creator>Todd B</dc:creator><description>&lt;p&gt;I've noticed that with the Self Tracking Entities, when the ObjectContext's SavingChanges event is fired, the ObjectStateManager.GetObjectStateEntriesObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Modified) returns an empty list when there are modifications that actually do get persisted. &amp;nbsp;I want to be able to trap whenever and however an Entity is being saved. Is there another method I can employ to do this with the Self Tracking Entities?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9852264</link><pubDate>Wed, 29 Jul 2009 19:27:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9852264</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;@Todd: Please, try invoking the context's DetectChanges() method before GetObjectStateEntries(). Self tracking entities are POCO objects without change notification, therefore it is necessary to push the changes from the object graph to the ObjectStateManager before invoking any API that requires having the ObjectStateManaer up to date.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9852305</link><pubDate>Wed, 29 Jul 2009 20:01:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9852305</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;@Ken: tracking of changes on the client depends on the change tracking logic embeded in the entity types. Our current impementation has a couple of source code incompatibilities with the Silverlight version of the CLR and BCL, but we will work on that. We don't have plans to generate self-tracking entities as the default for WCF clients.&lt;/p&gt;
&lt;p&gt;Also, if you need a rich application framework for Silverlight that works with Entity Framework, you may want to try .NET RIA Services.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9852402</link><pubDate>Wed, 29 Jul 2009 21:26:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9852402</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;@Martin: Yes, the way I did the walkthrough I basically leave the original copy of the TT files in the same project as the EDMX file because the TT file needs to find the EDMX file in a relative path (although you can override the exact location by editing the TT file). Then I &amp;quot;add as linked&amp;quot; the TT files wherever I need them and that should automatically bring the linked generated files. I am not sure what can go wrong, but I guess my first recommendation if that doesn't happen is to revert things to the previous step (i.e. remove the linked TT file) and add it again.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Diego&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9857194</link><pubDate>Tue, 04 Aug 2009 18:27:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9857194</guid><dc:creator>ncloud</dc:creator><description>&lt;p&gt;Hi, I'm trying to persist an object graph across the service. &amp;nbsp;The object graph looks like this:&lt;/p&gt;
&lt;p&gt;Course&lt;/p&gt;
&lt;p&gt;|- Professor Professor&lt;/p&gt;
&lt;p&gt;|- List&amp;lt;Student&amp;gt; Students&lt;/p&gt;
&lt;p&gt;When I change the Professor through databinding in WPF, the Course.ChangeTracker contains a reference to the original Professor in the OriginalValuesForReferenceProperties collection. &amp;nbsp;I use the ApplyChanges() method on the data context service side, and the first update works fine. &amp;nbsp;But if I change the Professor again, the SaveChanges() method of the data context says there is a duplicate key. &amp;nbsp;The Course.ChangeTracker also still maintains its original reference to the first Professor, which I am assuming is causing the duplicate key violation, but I can't seem to reset the ChangeTracker client side. &amp;nbsp;If I call Course.MarkAsUnchanged() on the client, the old Professor reference still remains. &amp;nbsp;My service call returns void, just like the examples above... but I've seen other people returning the same object after the database update. &amp;nbsp;Anyone having similar problems?&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9862003</link><pubDate>Sun, 09 Aug 2009 10:12:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9862003</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;@ncloud: can you please explain what do you mean with &amp;quot;if I change the Professor again&amp;quot;?&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9871056</link><pubDate>Sat, 15 Aug 2009 16:34:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9871056</guid><dc:creator>uns_uwe</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;really a great Job!&lt;/p&gt;
&lt;p&gt;I start to use this functionality for a new application!&lt;/p&gt;
&lt;p&gt;Stay tuned!!!&lt;/p&gt;
&lt;p&gt;Uwe&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9895104</link><pubDate>Mon, 14 Sep 2009 22:29:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9895104</guid><dc:creator>dz</dc:creator><description>&lt;p&gt;i can't get it work for me.&lt;/p&gt;
&lt;p&gt;I gave two related tables: Product and ProductCategory, and three WCF methods: GetProduct, GetCategory and UpdateProduct. If i'm changing simple properties of Product, it works fine, but if i'm assigning like this:&lt;/p&gt;
&lt;p&gt;product.ProductCategory = wcfClient.GetCategory(catId)&lt;/p&gt;
&lt;p&gt;and call UpdateProduct, it throws exception. From other side it doesn't work either, if I'm doing like productCategory.Products.Add(product) and call product category update, it falls with exception also.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9909561</link><pubDate>Tue, 20 Oct 2009 00:27:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9909561</guid><dc:creator>platon</dc:creator><description>&lt;p&gt;Hi, thanks for the article!&lt;/p&gt;
&lt;p&gt;I have been having issues with &amp;quot;Unable to load the specified metadata resource&amp;quot; error. I have the following setup (just two tier)&lt;/p&gt;
&lt;p&gt;Project 1: EntityModel (contains the edmx file with Embed in Output Assembly for the Metadat Artifact Processing)&lt;/p&gt;
&lt;p&gt;Project 2: EntityTypes (contains EntityModel.Types.tt)&lt;/p&gt;
&lt;p&gt;Project 3: DataAccess (contains EntityModel.Context.tt) and references EntityModel project.&lt;/p&gt;
&lt;p&gt;Project 4: ConsoleApp (calls a DataAccess static method which instantiates the EntityContext). &lt;/p&gt;
&lt;p&gt;The config file looks like this:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;connectionStrings&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;add name=&amp;quot;EntityContext&amp;quot; connectionString=&amp;quot;metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string=&amp;amp;quot;Data Source=TEST;Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=test;MultipleActiveResultSets=True&amp;amp;quot;&amp;quot; providerName=&amp;quot;System.Data.EntityClient&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;/connectionStrings&amp;gt;&lt;/p&gt;
&lt;p&gt;When I instantiate the EntityContext in the DataAccess, I get the following exception:&lt;/p&gt;
&lt;p&gt;&amp;quot;Unable to load the specified metadata resource&amp;quot;.&lt;/p&gt;
&lt;p&gt;I found that the EntityModel assembly is not loaded. After loading it explicitely from the DataAccess things work fine. &lt;/p&gt;
&lt;p&gt;I would appreciate if anyone has suggestions. Loading assembly explicitely seems like a hack to me.&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9910033</link><pubDate>Tue, 20 Oct 2009 16:56:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9910033</guid><dc:creator>uns_uwe</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;is this functionality still available under Beta2 and later in the final release?&lt;/p&gt;
&lt;p&gt;Thanks a lot!&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9917473</link><pubDate>Wed, 04 Nov 2009 19:12:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9917473</guid><dc:creator>Júlio</dc:creator><description>&lt;p&gt;One question, i have a web service that return a System.Data.Entity.DynamicProxies and occur error this class is not serializable, what i can do????&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9918808</link><pubDate>Fri, 06 Nov 2009 21:02:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9918808</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;Hi Julio,&lt;/p&gt;
&lt;p&gt;I think I already responded to you in the forums, but for the benefit of others that might hit this page: this is a known issue. The solution is not included in beta 2, but he workaround is to temporarily disable the creation of proxies when you are returning entities that you plan to return from the service. Use context.ContextOptions.ProxyCreationEnabled = false.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Diego&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9918811</link><pubDate>Fri, 06 Nov 2009 21:04:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9918811</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;@uns_uwe: Hi, an updated version of the CTP that is compatible with beta 2 has been released. You can find the announcement here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/adonet/archive/2009/11/04/ado-net-entity-framework-community-technology-preview-released.aspx"&gt;http://blogs.msdn.com/adonet/archive/2009/11/04/ado-net-entity-framework-community-technology-preview-released.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9919292</link><pubDate>Sun, 08 Nov 2009 20:59:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9919292</guid><dc:creator>Steve</dc:creator><description>&lt;p&gt;How do I create self-tracking poco objects.&lt;/p&gt;
&lt;p&gt;I can only select one of the two templates.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9921209</link><pubDate>Thu, 12 Nov 2009 06:27:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9921209</guid><dc:creator>Jarod Ferguson</dc:creator><description>&lt;p&gt;Nice work. If this works out Ill be excited to delete piles of code!&lt;/p&gt;
&lt;p&gt;This actually has quite a bit of value in regular asp.net or mvc.net. With self tracking entities customers can use clean testable patterns (controllers, repos, pocos) and steer clear of the EntityDataSource.&lt;/p&gt;
&lt;p&gt;Whats up with these names though :)&lt;/p&gt;
&lt;p&gt;FixupChangeTrackingCollection&lt;/p&gt;
&lt;p&gt;EntityChangeTrackerAdapter&lt;/p&gt;
&lt;p&gt;Also, is it neccesary to specify EntityChangeTrackerAdapter.GetSelfTrackingEntityInfo when saving? If your applying changes shouldnt it be implicit that you need to get the GetSelfTrackingEntityInfo?&lt;/p&gt;
&lt;p&gt;------------&lt;/p&gt;
&lt;p&gt; context.Entries.ApplyChanges(&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;post, &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EntityChangeTrackerAdapter.GetSelfTrackingEntityInfo);&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9922798</link><pubDate>Mon, 16 Nov 2009 04:51:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922798</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;@Steve: The entity types the Self-Tracking Entities Template produces are POCO objects in the sense that they don't have a dependency with Entity Framework, but of course they include additional code to track changes. The goal of the POCO Template (which by the way is not included in the Feature CTP 2) is to produce simple types that can work as entities in Entity Framework. With the current approach we can’t support functionality like ApplyChanges without the additional code in self-tracking entities, so you will need to choose among the two depending on whether this functionality is important for your application. &lt;/p&gt;
&lt;p&gt;Hope this answers your question,&lt;/p&gt;
&lt;p&gt;Diego&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9922802</link><pubDate>Mon, 16 Nov 2009 05:18:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922802</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;@Jarod: Thanks for the feedback on this! In the updated version of the Self-Tracking Entities template included in the Feature CTP2 we changed the implementation of collections quite a bit. The new collection type is called TrackableCollection and is based on ObservableCollection. Besides, we were able to remove the second parameter of the ApplyChanges method as now the template actually generates the code for ApplyChanges and then we can make it depend on the entity types. We have also paid more attention in general to names and to the code we generate, although there are still a few things we are still planning to improve before RTM.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Diego&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9922889</link><pubDate>Mon, 16 Nov 2009 11:26:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922889</guid><dc:creator>Jose Coelho</dc:creator><description>&lt;p&gt;Hi &amp;nbsp; &lt;/p&gt;
&lt;p&gt;I'm trying the self tracking entities and i have notice that when we call the method &amp;nbsp;entity.AcceptChanges() it doesn't propagate the AcceptChanges to the child entities and when we make changes to a child entity the parent entity isn't warned that something has changed, is this normal behaviour or is it bug?&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Also is it possible to have a method &amp;nbsp;HasChanges() in the entity. &lt;/p&gt;
&lt;p&gt;Many thanks&lt;/p&gt;
&lt;p&gt;JC&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9926322</link><pubDate>Fri, 20 Nov 2009 17:33:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9926322</guid><dc:creator>Jose Coelho</dc:creator><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt; If anyone is interested this is my version of the AcceptChanges():&lt;/p&gt;
&lt;p&gt; public static void AcceptChanges(this IObjectWithChangeTracker trackingItem)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (trackingItem == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new ArgumentNullException(&amp;quot;trackingItem&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;		 Type t = trackingItem.GetType();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PropertyInfo[] props = t.GetProperties();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (PropertyInfo p in props)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (p.PropertyType.Name == &amp;quot;TrackableCollection`1&amp;quot;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IList list = (IList)p.GetValue(trackingItem, null);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (IObjectWithChangeTracker b in list)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b.ChangeTracker.AcceptChanges();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;trackingItem.ChangeTracker.AcceptChanges();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;JC&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9926490</link><pubDate>Fri, 20 Nov 2009 22:19:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9926490</guid><dc:creator>Graham</dc:creator><description>&lt;p&gt;Where can I find any discussion which might be going on regarding the future of self-tracking entities and ASP.NET web forms? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Currently, to update a small number of fields for an entity using a web form I choose to re-query my BL, allow ASP.NET to update the bound fields, pass the updated entity to my BL, and apply changes (including FKs). &amp;nbsp;Before I get carried away I would really like to know when I might expect to be better off using self-tracking entities. (MVC is not in my future.)&lt;/p&gt;
&lt;p&gt;Also, being my first ever contact with the team I wanted to thank Diego, Danny, Alex and the whole Entity Framework team for what you have done. You had my vote of confidence the day I read about EF, when I understood the big picture which some people were too close (to their own product) to see. Keep up the pace of development and you'll continue to earn the respect you deserve.&lt;/p&gt;
&lt;p&gt;Graham&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9926830</link><pubDate>Sat, 21 Nov 2009 22:37:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9926830</guid><dc:creator>divega</dc:creator><description>&lt;p&gt;Hello Graham, &lt;/p&gt;
&lt;p&gt;Your kind words are appreciated. I will transmit your message to the team. &lt;/p&gt;
&lt;p&gt;We identified a scenario in in ASP.NET WebForms in which self-tracking entities could be very useful. I think this might be the scenario you are referring to: preserving graphs of entities with changes in ASP.NET state management objects (i.e. Session or ViewState) across postbacks. The main obstacle to use self-tracking entities in this way is that STEs don’t support binary serialization. There are workarounds for this, like serializing with a DataContractSerializer into a memory stream, but we still haven’t worked in a pattern that we can recommend. &lt;/p&gt;
&lt;p&gt;In many Web scenarios you usually modify one entity. If that is your case, you can probably use the approach that Danny explains here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/dsimmons/archive/2008/10/31/attachasmodified-a-small-step-toward-simplifying-ef-n-tier-patterns.aspx"&gt;http://blogs.msdn.com/dsimmons/archive/2008/10/31/attachasmodified-a-small-step-toward-simplifying-ef-n-tier-patterns.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This approach works great with the new support for FKs, because FKs are now structurally part of the entity so relationships get affected by the method. &lt;/p&gt;
&lt;p&gt;Finally, you can consider using the EntityDataSource, which makes doing CRUD operations with Entity Framework very easy in ASP.NET WebForms applications. Although from your description of the scenario it seems that you have better layer separation.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Diego&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9927414</link><pubDate>Mon, 23 Nov 2009 17:50:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927414</guid><dc:creator>Droje Dar</dc:creator><description>&lt;p&gt;Hi to all, i have a problem with Self-Tracking Entities:&lt;/p&gt;
&lt;p&gt;method DeletePerson not works,but DeletePersonTwo&lt;/p&gt;
&lt;p&gt;works , why???. It looks the same&lt;/p&gt;
&lt;p&gt;public class PersonAD&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; public void DeletePerson(int ID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; using(BloggingContainer ctx = new BloggingContainer)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Person p = (from p in ctx.PersonSet&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where p.Id == ID&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;select p).First();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; person.MarkAsDeleted();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.PersonSet.ApplyChanges(person);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.SaveChanges();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; public void DeletePersonTwo(int ID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; using(BloggingContainer ctx = new BloggingContainer)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Person p = this.GetPerson(ID);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; person.MarkAsDeleted();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.PersonSet.ApplyChanges(person);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.SaveChanges();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; public Person GetPerson(int ID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using(BloggingContainer ctx = new BloggingContainer)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Person p = (from p in ctx.PersonSet&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where p.Id == ID&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;select p).First();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; return p;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9927426</link><pubDate>Mon, 23 Nov 2009 18:06:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927426</guid><dc:creator>Droje Dar</dc:creator><description>&lt;p&gt;Sorry,some mistakes in writing at first, but the same question again:&lt;/p&gt;
&lt;p&gt;method DeletePerson not works,but DeletePersonTwo&lt;/p&gt;
&lt;p&gt;works , why???. It looks the same&lt;/p&gt;
&lt;p&gt;public class PersonAD&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; //NOT works&lt;/p&gt;
&lt;p&gt; &amp;nbsp; public void DeletePerson(int ID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; using(BloggingContainer ctx = new BloggingContainer())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Person personToDelete = (from p in ctx.PersonSet&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; where p.Id == ID&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select p).First();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; personToDelete.MarkAsDeleted();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.PersonSet.ApplyChanges(personToDelete);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.SaveChanges();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp;//Works&lt;/p&gt;
&lt;p&gt; &amp;nbsp;public void DeletePersonTwo(int ID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; using(BloggingContainer ctx = new BloggingContainer())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Person personToDelete = this.GetPerson(ID);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; personToDelete.MarkAsDeleted();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.PersonSet.ApplyChanges(personToDelete);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ctx.SaveChanges();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; public Person GetPerson(int ID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using(BloggingContainer ctx = new BloggingContainer())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Person myPerson = (from p in ctx.PersonSet&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where p.Id == ID&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;select p).First();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; return myPerson;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9927433</link><pubDate>Mon, 23 Nov 2009 18:21:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927433</guid><dc:creator>Jose Coelho</dc:creator><description>&lt;p&gt;Hi Droje Dar&lt;/p&gt;
&lt;p&gt;I think that you must attach de entity to the context prior to the deleting:&lt;/p&gt;
&lt;p&gt;try something like this&lt;/p&gt;
&lt;p&gt; using (TransactionScope tx = new TransactionScope())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;using (BloggingContainer ctx = new BloggingContainer ())&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ctx.AttachTo(&amp;quot;PersonSet&amp;quot;, entity);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ctx.PersonSet.DeleteObject(entity);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ctx.SaveChanges();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tx.Complete();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;JC&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9927643</link><pubDate>Tue, 24 Nov 2009 00:29:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927643</guid><dc:creator>Stephen Ward</dc:creator><description>&lt;p&gt;How would this work with MVC?&lt;/p&gt;
&lt;p&gt;If the controller passed the self tracking entity to a strongly typed view, the entity would be lost when the form is submitted as all we have then is the submitted values. &lt;/p&gt;
&lt;p&gt;This is unless we store the original entity somewhere such as the Session and then retrieve it when the values are posted to the Controller. This seems ugly and not scalable to me.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9928526</link><pubDate>Wed, 25 Nov 2009 13:15:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9928526</guid><dc:creator>ymadav</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I've noticed a bug in the ChangeTracker.&lt;/p&gt;
&lt;p&gt;When I call the SaveChanges method after I saved new entities, the ObjectState of the ChangeTracker is still &amp;quot;Added&amp;quot; and not UnChanged as expected.&lt;/p&gt;
&lt;p&gt;Any idea why? or how can I simply resolve it instead of coding additional background code?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Yaniv.&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9931654</link><pubDate>Wed, 02 Dec 2009 22:29:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9931654</guid><dc:creator>maprc1064</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Can anyone point me in a direction to get a list of the properties that have changed? &amp;nbsp;I can't seem to find the original values on my objects. &amp;nbsp;the OriginalValues collection count is always 0 even when one of my properties is changed. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Melinda&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9934310</link><pubDate>Tue, 08 Dec 2009 23:30:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934310</guid><dc:creator>David McCarter</dc:creator><description>&lt;p&gt;How does this work with Data Services. What do I put in &amp;nbsp;DataService&amp;lt;&amp;gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;David McCarter&lt;/p&gt;
</description></item><item><title>re: Feature CTP Walkthrough: Self Tracking Entities for the Entity Framework (Updated)</title><link>http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx#9934321</link><pubDate>Wed, 09 Dec 2009 00:08:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934321</guid><dc:creator>David McCarter</dc:creator><description>&lt;p&gt;Also, in my ADO Data Service project, it won't let me add the context file as a link. Any ideas why??&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
</description></item></channel></rss>