I have a type that is derived from an Entity generated by the Entity Framework 3. How do I assign one Customer's Order property to the Derived Customer's Order property?
derivedCustomer.Orde开发者_JAVA技巧rs = customer.Orders
I'm not actually trying to swap orders; this is just an example of what I am trying to achieve. Has anyone done tried this and succeed?
Loop through each record and add to the other collection:
foreach (var order in customer.Orders)
derivedCustomer.Orders.Add(order);
You could make an extension method to make that seamless too.
精彩评论