<?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 47 – How fix-up can make it hard to change relationships</title><link>http://blogs.msdn.com/b/alexj/archive/2009/12/02/tip-47-how-fix-up-can-make-it-hard-to-change-relationships.aspx</link><description>Problem: 
 Take this code: 
 Category oldCategory = ctx.Categories .Include("Products") .First(c =&amp;gt; c.Name == "Drink"); Category newCategory = new Category {Name = "Beverage"}; foreach(Product product in oldCategory.Products) { newCategory.Products</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Tip 47 – How fix-up can make it hard to change relationships</title><link>http://blogs.msdn.com/b/alexj/archive/2009/12/02/tip-47-how-fix-up-can-make-it-hard-to-change-relationships.aspx#9932459</link><pubDate>Fri, 04 Dec 2009 12:14:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9932459</guid><dc:creator>Shimmy Weitzhandler</dc:creator><description>&lt;p&gt;Richard, good idea, but Y not ToArray that also has these extensions, and takes a few bytes less than a list :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9932459" width="1" height="1"&gt;</description></item><item><title>re: Tip 47 – How fix-up can make it hard to change relationships</title><link>http://blogs.msdn.com/b/alexj/archive/2009/12/02/tip-47-how-fix-up-can-make-it-hard-to-change-relationships.aspx#9931512</link><pubDate>Wed, 02 Dec 2009 17:36:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9931512</guid><dc:creator>Richard</dc:creator><description>&lt;p&gt;How about:&lt;/p&gt;
&lt;p&gt;oldCategory.Products.ToList().ForEach(newCategory.Products.Add);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9931512" width="1" height="1"&gt;</description></item></channel></rss>