自我跟踪实体 - 无法从导航属性中删除子项 [英] Self Tracking Entities - Unable to Delete Child from Navigation Property

查看:71
本文介绍了自我跟踪实体 - 无法从导航属性中删除子项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这真是令人头疼的事。我有2个实体。实体A有一个导航属性,它是实体B的可跟踪集合。我可以添加新的实体B,更新现有的实体B,但我不能从我的集合中删除任何实体B.我为我的POCO修改了我的T4
模板,将这一行包含在构造函数中:


 
.StartTracking();

解决方案

这个帖子应该有所帮助:

http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread / f54273f7-6cdf-4f82-b184-0790c53bef0c

This is a real head-scratcher. I have 2 entities. Entity A has a navigation property which is a trackable collection of Entity B. I can add new Entity B's, update existing Entity B's, but I cannot delete any Entity B's from my collection. I modified my T4 template for my POCO's to include this line in the constructor:

this.StartTracking();

解决方案

This thread should help:
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/f54273f7-6cdf-4f82-b184-0790c53bef0c


这篇关于自我跟踪实体 - 无法从导航属性中删除子项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆