我们有 2 个班级,Parent 和 Child
父级没有对子级的引用,子级在其流利映射中定义了以下内容:
References(x => x.Parent, "Parent_id").Not.Nullable();
删除父记录时,会产生以下错误:
The DELETE statement conflicted with the REFERENCE constraint "FKFF68C21EE06905B9". The conflict occurred in database "DatabaseName", table "dbo.tblChild", column 'Parent_id'.
The statement has been terminated.
考虑到父模型没有子类型的属性集合,启用删除父模型的正确映射是什么?