private static Cascade Cleanup(Cascade cascade) { bool hasAll = cascade.Has(Cascade.All) || cascade.Has(AnyButOrphans); if (hasAll && cascade.Has(Cascade.DeleteOrphans)) { return Cascade.All | Cascade.DeleteOrphans; } if (hasAll) { return Cascade.All; } return cascade; }
private static Cascade Cleanup(Cascade cascade) { bool hasAll = cascade.Has(Cascade.All) || cascade.Has(AnyButOrphans); if (hasAll && cascade.Has(Cascade.DeleteOrphans)) { return(Cascade.All | Cascade.DeleteOrphans); } if (hasAll) { return(Cascade.All); } return(cascade); }
private static IEnumerable <string> CascadeDefinitions(this Cascade source) { if (source.Has(Cascade.All)) { yield return("all"); } if (source.Has(Cascade.Persist)) { yield return("save-update, persist"); } if (source.Has(Cascade.Refresh)) { yield return("refresh"); } if (source.Has(Cascade.Merge)) { yield return("merge"); } if (source.Has(Cascade.Remove)) { yield return("delete"); } if (source.Has(Cascade.Detach)) { yield return("evict"); } if (source.Has(Cascade.ReAttach)) { yield return("lock"); } if (source.Has(Cascade.DeleteOrphans)) { yield return("delete-orphan"); } }
public static Cascade Exclude(this Cascade source, Cascade value) { if (source.Has(Cascade.All) && !value.Has(Cascade.All)) { return(Cleanup(((source & ~Cascade.All) | AnyButOrphans) & ~value)); } return(Cleanup(source & ~value)); }
public static Cascade Exclude(this Cascade source, Cascade value) { if (source.Has(Cascade.All) && !value.Has(Cascade.All)) { return Cleanup(((source & ~Cascade.All) | AnyButOrphans) & ~value); } return Cleanup(source & ~value); }