0

I have two entities TestA and TestB, the relationship is one to many. After removing an entity from the TestB collection in TestA entity, I found the EntityState of that removed entity is 'Modified'. Is there a way to distinguish the removed entity with the really modified entity?

James
  • 2,570
  • 7
  • 34
  • 57

1 Answers1

0

Yes because it is modified. When you remove TestB entity from collection in TestA entity you are not removing entity itself but you are removing just relation between TestA and TestB = you are setting FK in TestB to null. If you want to remove TestB as well you must either call DeleteObject for that TestB instance or use identifying relation.

Community
  • 1
  • 1
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670