I have this code where all objects are created by Entity Framework 4.1:
public void UpdateCustomer(int CustomerID, IList<Order> CustomerOrders)
{
foreach (var OrderItem in CustomerOrders)
{
Customer.Order = OrderItem;
}
}
When I try to assign OrderItem to Customer.Order, I receive the following error:
Error 15 Cannot implicitly convert type ‘Order’ to ‘System.Data.Objects.DataClasses.EntityCollection’
What am I doing wrong here, and how can this be fixed?
You should assign collection of orders not an order