问题描述
我似乎遇到了应该(我假设)的问题,非常简单。 我真的很感激任何帮助或指示。
I seem to be having problems with something that should (I assume), be very simple. I would really appreciaate any help or pointers.
我有一个非常基本的"节点"。实体:
I have a very basic "Node" Entity:
NodeId - Int32,key
NodeId - Int32, key
NodeName - String
NodeName - String
ParentNode - 节点(0 .. 1)
ParentNode - Node (0..1)
子节点 - 节点集合(0 .. *)
SubNodes - Collection of Node (0..*)
我想删除父节点以自动删除所有子节点。  这可能吗?
I would like the deletion of a parent node to automatically delete all subnodes. Is this possible?
当我将End2OnDelete规则设置为级联时,我会收到:
When I set the End2OnDelete rule to cascade I receive:
错误 1   错误132:关系'NodeModel.NodeNode'上的结束'Node1'不能指定操作,因为它的多重性是'*'。无法在具有多重性'*'的结尾处指定操作。 C:\MemoryScienceDevelopment\TreeDeleteTest1\TreeDeleteTest1\NodeModel.edmx   
21 5    TreeDeleteTest1
Error 1 Error 132: End 'Node1' on relationship 'NodeModel.NodeNode' cannot have operation specified since its multiplicity is '*'. Operations cannot be specified on ends with multiplicity '*'. C:\MemoryScienceDevelopment\TreeDeleteTest1\TreeDeleteTest1\NodeModel.edmx 21 5 TreeDeleteTest1
我应该以不同方式构建我的节点实体吗? 我应该以不同方式设置OnDelete规则吗? 我真的不必为级联删除编写我自己的递归例程吗?是吗?
Should I structure my Node Entity differently? Should I set up the OnDelete rules differently? I don't really have to write my own recursive routines for cascade deletes, do I?
任何帮助都将不胜感激。
Any help would be greatly appreciated.
谢谢,
Chris
推荐答案
这篇关于级联删除基本“节点”实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!