예제 #1
0
        IValitRules<TObject> IValitRules<TObject>.Ensure<TProperty>(Expression<Func<TObject, TProperty>> selector, IValitator<TProperty> valitator)
        {
            selector.ThrowIfNull();
            valitator.ThrowIfNull();

            var nestedValitRule = new NestedObjectValitRule<TObject, TProperty>(selector, valitator, _strategy);
            _rules.Add(nestedValitRule);
            return this;
        }
예제 #2
0
        IValitRules <TObject> IValitRules <TObject> .Ensure <TProperty>(Func <TObject, TProperty> selector, IValitRulesProvider <TProperty> valitRulesProvider)
        {
            selector.ThrowIfNull();
            valitRulesProvider.ThrowIfNull();

            var nestedValitRule = new NestedObjectValitRule <TObject, TProperty>(selector, valitRulesProvider, _strategy);

            _rules.Add(nestedValitRule);
            return(this);
        }