I have a tree structure and need to make a cascade delete. I've read somewhere that marking properties of my poco object with RelatedToAttribute attribute and KeyAttribute would 开发者_开发技巧do the trick. But I can't find RelatedToAttribute anywhere.
I am using mvc 3 (.net 4, VS 2010)
There is no RelatedToAttribute
. It was attribute in some old CTP version of Entity Framework Feature. KeyAttribute
is in System.ComponentModel.DataAnnotations
assembly.
Cascade delete in Entity framework requires setting ON DELETE CASCADE in database and in entity model (or code first mapping).
精彩评论