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; }
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); }