如何在NHibernate中通过代码映射设置cascade到all-delete-orphans?
[Flags]
public enum Cascade
{
None = 0,
Persist = 2,
Refresh = 4,
Merge = 8,
Remove = 16,
Detach = 32,
ReAttach = 64,
DeleteOrphans = 128,
All = 256,
}
我如何结合All& DeleteOrphans?
答案 0 :(得分:7)
尝试使用:
r.Cascade(Cascade.All | Cascade.DeleteOrphans);
因为Cascade是[Flag] ...可以使用multi:
What does the [Flags] Enum Attribute mean in C#?