Exemple #1
0
 internal static bool RaiseDbValidationContextError(this IReactiveDbContext context, ValidationEntitiesException ex)
 {
     if (context.ValidationErrorCountSubscriber == 0)
     {
         return(true);
     }
     context.RaiseValidationError(ex);
     return(true);
 }
        private static bool RaiseValidationFailedEvents <TReactiveDbcontext>(this TReactiveDbcontext context, ValidationEntitiesException ex) where TReactiveDbcontext : IReactiveDbContext
        {
            var entityResult  = false;
            var contextResult = false;

            contextResult = context.RaiseDbValidationContextError(ex);
            ex.Errors.Errors.ForEach(entry =>
            {
                entityResult = ((IReactiveDbObject)entry.Entity).RaiseDbValidationEntityError(entry.Exception) && true;
            });
            return(contextResult || entityResult);
        }