Esempio n. 1
0
        public SyncPropertyValidator <TProp> Setup <TProp>(Expression <Func <TObject, TProp> > expression)
        {
            var memberInfo = PropertyExtractor.Extract(expression);

            if (PropertyValidators.TryGetValue(memberInfo.Name, out var propertyValidator))
            {
                return((SyncPropertyValidator <TProp>)propertyValidator);
            }

            var newPropertyValidator = new SyncPropertyValidator <TProp>(memberInfo);

            PropertyValidators.Add(memberInfo.Name, newPropertyValidator);

            return(newPropertyValidator);
        }