예제 #1
0
        private static CascadeOn Cleanup(CascadeOn cascade)
        {
            bool hasAll = cascade.Has(CascadeOn.All) || cascade.Has(AnyButOrphans);

            if (hasAll && cascade.Has(CascadeOn.DeleteOrphans))
            {
                return(CascadeOn.All | CascadeOn.DeleteOrphans);
            }
            if (hasAll)
            {
                return(CascadeOn.All);
            }
            return(cascade);
        }
예제 #2
0
 public static CascadeOn Exclude(this CascadeOn source, CascadeOn value)
 {
     if (source.Has(CascadeOn.All) && !value.Has(CascadeOn.All))
     {
         return(Cleanup(((source & ~CascadeOn.All) | AnyButOrphans) & ~value));
     }
     return(Cleanup(source & ~value));
 }
예제 #3
0
 private static Cascade IncludeIfNeeded(CascadeOn source, CascadeOn valueToCheck, Cascade destination)
 {
     return(source.Has(valueToCheck) ? destination.Include(ConvertSingleValue(valueToCheck)) : destination);
 }