开发者

Delete Entity in Entity Framework 4.0

I have two tables without any cascade deleting, the two tables have 1 to many relation ship.

When loading the entities that map that tables , and try to delete the parent entity then 2 scenarios will execute:

  1. The e开发者_StackOverflow社区ntity framework will force the cascade delete when both entities were loaded.
  2. If the child entity was not loaded it will raise an exception

How to guarantee that the entity framework will execute the second scenario always???? What I mean, I need to raise an exception without force delete cascade behavior.

thank you so much.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜