/// <inheritdoc/>
        public ICollectionPropertyRuleBuilder <TContext, TSubject, TProperty> WithProperty <TProperty> (
            Expression <Func <TSubject, IEnumerable <TProperty> > > propertyExpression)
        {
            var collectionPropertyRule = CollectionPropertyRule.CreateCollectionPropertyRule(propertyExpression, _name);

            _addRuleCallBack(collectionPropertyRule);
            return(new CollectionPropertyRuleBuilder <TContext, TSubject, TProperty> (collectionPropertyRule));
        }
Example #2
0
        internal static CollectionPropertyRule CreateCollectionPropertyRule <T, TProperty> (
            Expression <Func <T, TProperty> > propertyExpression, string name) where TProperty : IEnumerable
        {
            var propertyRule = new CollectionPropertyRule(propertyExpression, name)
            {
                PropertyValueDelegate = propertyExpression.Compile()
            };

            return(propertyRule);
        }
Example #3
0
 internal CollectionPropertyRuleBuilder(CollectionPropertyRule collectionPropertyRule)
     : base(collectionPropertyRule)
 {
     _collectionPropertyRule = collectionPropertyRule;
 }