Esempio n. 1
0
        public static ValidationHandleOperation HandleAll(this ValidationHandleOperation op, IValidationHandler handler)
        {
            op.CheckNull(nameof(op));
            handler.CheckNull(nameof(handler));

            op.Handle(handler);

            return(op);
        }
Esempio n. 2
0
        public static ValidationHandleOperation HandleForFailure(this ValidationHandleOperation op, IValidationHandler handler)
        {
            op.CheckNull(nameof(op));
            handler.CheckNull(nameof(handler));

            op.Handle(handler, x => x.Where(y => !y.IsValid));

            return(op);
        }
Esempio n. 3
0
        public static ValidationHandleOperation HandleForStrategy(this ValidationHandleOperation op, string name,
                                                                  IValidationHandler handler)
        {
            op.CheckNull(nameof(op));
            handler.CheckNull(nameof(handler));

            op.Handle(handler, name);

            return(op);
        }
Esempio n. 4
0
        internal void Handle(IValidationHandler handler, string strategyName)
        {
            handler.CheckNull(nameof(handler));
            var coll = _collection.Filter(strategyName);

            if (coll == null)
            {
                return;
            }

            handler.Handle(coll);
        }
Esempio n. 5
0
        internal void Handle(IValidationHandler handler, Action <IEnumerable <ValidationResult> > filterFunc = null)
        {
            handler.CheckNull(nameof(handler));
            var coll = filterFunc == null ? _collection : _collection.Filter(filterFunc);

            if (coll == null)
            {
                return;
            }

            handler.Handle(coll);
        }