I'm using v1 of EF(.NET 3.5 SP1). I'm subscribing to the SavingChanges event of the ObjectContext wherein I audit deletes for a particular entity type. I need to get to the foreign keys of the entity being deleted i.e EntityKeys of the related entities (RelatedEnds) but the EntityKeys of the related e开发者_JAVA技巧ntities are nulls.
Is there any way to get to the foreign keys of an entity which has been marked for deletion? Does EF null out the EntityKeys of all RelatedEnds for an entity which has been marked for deletion? If so, is there a way I can get hold of the foreign keys?
I finally found an answer on the MSDN forums. http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/e4c4739f-731a-491a-a4c9-eb3c91f7c7eb
精彩评论