10
Shouts

Meta-Me : Tip 47 – How fix-up can make it hard to change relationships

published 1268 days, 2 hours, 45 minutes ago posted by https://me.yahoo.com/mosessaur#7fe0dhttps://me.yahoo.com/mosessaur#7fe0d 1269 days, 2 hours, 38 minutes ago
Thursday, December 03, 2009 9:06:40 AM GMT Wednesday, December 02, 2009 9:13:24 AM GMT

Tip 47 – How fix-up can make it hard to change relationships Problem: Take this code: Category oldCategory = ctx.Categories     .Include("Products")     .First(c => c.Name == "Drink");

Category newCategory = new Category {Name = "Beverage"};

foreach(Product product in oldCategory.Products) {     newCategory.Products.Add(product); } Ignore for a second that in this example the solution is probably just to rename the oldCategory "Beverages" - Coming up with real world samples gets hard...

category: Architecture | clicked: 0 | | source: blogs.msdn.com | show counter code
tags: entityframework 4, entityframework4, Entity Framework, EF4, EF 4.0, entityframework, Tips