I have two tables, Order and OrderItems
The Order table has a OrderId column that's the primary key The OrderItems also has this column as foriegn key.
For a given Order, if the OrderId is 1 and it has two items the OrderItems table will have two rows each having OrderID as 1.
Using EF I created a context with the two tables.
Now the Order table and OrderItems table both have a Status column.
Using GraphDiff I wanted to update this value likes so:
using (var ordersContext = new OrdersContext())
{
ordersContext.UpdateGraph(orderToUpdate, map => map.OwnedCollection(p => p.OrderItems));
ordersContext.SaveChanges();
}
This gives the following exception:
GraphDiff supports detached entities only at this time. Please try AsNoTracking() or detach your entites before calling the UpdateGraph method
Any clues?
Thanks in advance.