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.Orders = 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With