Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 257: }
Line 258: Me.ObjectContext.OrderStatusHistories.AddObject(_orderStatusHistory)
Line 259: Me.ObjectContext.Orders.AttachAsModified(currentOrder, Me.ChangeSet.GetOriginal(currentOrder))
Line 260: End Sub
Line 261:
订单是在数据库中提交的,有谁知道这里发生了什么?
答案 0 :(得分:0)
原来,变更集为空。所以在我的代码中添加了一个if changeset不为null,如果没有变更集,我不需要运行代码。