开发者

Me.ChangeSet.GetOriginal, Object reference not set to an instance of an object

hey , I have a problem with updating a record using a domain service, entity framework and asp.net.

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.AddObjec开发者_开发知识库t(_orderStatusHistory)
Line 259:        Me.ObjectContext.Orders.AttachAsModified(currentOrder, Me.ChangeSet.GetOriginal(currentOrder))
Line 260:    End Sub
Line 261:

The order is commited in the database, does anyone know whats going on here?


Turns out the changeset was null. So in my code added an if changeset is not null, i dont need to run the code if there isnt a changeset.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜