예제 #1
0
        public IAddBusinessError <T> WhenNull <T1>(Func <T, T1> func)
        {
            var busError = new AddBusinessError <T>(this);

            var validator = new NullPropertyValidator <T, T1>(func, model);

            errorList.Add(Tuple.Create <IAddBusinessError, IPropertyValidator, Func <Type> >
                              (busError, validator, () => typeof(INullPropertyValidator)));

            return(busError);
        }
예제 #2
0
        public IAddBusinessError <T> WhenEmpty(Func <T, string> action)
        {
            var busError = new AddBusinessError <T>(this);

            var validator = new StringPropertyValidator <T>(action, model);

            errorList.Add(Tuple.Create <IAddBusinessError, IPropertyValidator, Func <Type> >
                              (busError, validator, () => typeof(IPropertyValidator)));

            return(busError);
        }