1
我有一个Request
实体,它具有Buildings
(多对多)和RequestTimes
(一对多)的引用/子对象。我将它从我的实体对象上下文中分离出来,重新使用了一个Request
对象。实体克隆和清除引用
当我脱离我Request
和去插入另一Request
插入精细新的标识,新的条目添加到我的Buildings
查找表,但我RequestTimes
表更新现有的条目,并指出他们在新Request
ID而不是生成新的行。
到目前为止,我已经尝试使用objContext.Detach()
为每个RequestTime
条目以及调用Request.RequestTimes.Clear()
。我还有什么遗漏?