For instance, how do I make that determination here, whether is an Insert, Update or Delete?
void SaveRow(Order order)
{
ordersGrid.UpdateRow(order);
}
You can check the entity state: var orderEntry = dbContext.Entry(order);. For example orderEntry.State == EntityState.Modified is when you modify exiting item (update).
// For demo purposes only
order.Customer = dbContext.Customers.Find(order.CustomerID);
order.Employee = dbContext.Employees.Find(order.EmployeeID);
// For production
//dbContext.SaveChanges();
}
Is there anything else I should be doing? It adds the record. However, it stays in Edit mode and never refresh the grid. I tried using the Reload() but that did not work either.