public static OuterJoinNode <T1, T2> Outer <T1, T2>(this RuntimeConfigurator configurator,
                                                     RightActivation <T2> rightActivation)
     where T1 : class
     where T2 : class
 {
     return(configurator.CreateNode(id => new OuterJoinNode <T1, T2>(id, rightActivation)));
 }
 public static AddFactNode <T, TFact> AddFact <T, TFact>(this RuntimeConfigurator configurator,
                                                         Func <T, TFact> factFactory)
     where T : class
     where TFact : class
 {
     return(configurator.CreateNode(id => new AddFactNode <T, TFact>(id, factFactory)));
 }
예제 #3
0
        public static EqualNode <T, TProperty> Equal <T, TProperty>(this RuntimeConfigurator configurator)
            where T : class
        {
            EqualNode <T, TProperty> node = configurator.CreateNode(id => new EqualNode <T, TProperty>(id, configurator));

            return(node);
        }
        public static NotNullNode <T, TProperty> NotNull <T, TProperty>(this RuntimeConfigurator configurator)
            where T : class
            where TProperty : class
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new NotNullNode <T, TProperty>(id, tokenValue)));
        }
        public static ExistsNode <T, TProperty> Exists <T, TProperty>(this RuntimeConfigurator configurator)
            where T : class
            where TProperty : class, IEnumerable
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new ExistsNode <T, TProperty>(id, tokenValue)));
        }
        public static PropertyNode <T, TProperty> Property <T, TProperty>(
            this RuntimeConfigurator configurator, PropertyInfo propertyInfo, Action <T, Action <TProperty> > propertyMatch)
            where T : class
        {
            PropertyNode <T, TProperty> propertyNode =
                configurator.CreateNode(id => new PropertyNode <T, TProperty>(id, propertyInfo, propertyMatch));

            return(propertyNode);
        }
예제 #7
0
        public static CompareNode <T, TProperty> Compare <T, TProperty>(this RuntimeConfigurator configurator,
                                                                        Comparator <TProperty, TProperty> comparator,
                                                                        Value <TProperty> value)
            where T : class
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new CompareNode <T, TProperty>(id, tokenValue, comparator, value)));
        }
        public static EachNode <T, TProperty, TElement> Each <T, TProperty, TElement>(
            this RuntimeConfigurator configurator,
            Action <TProperty, Action <TElement, int> > elementMatch)
            where T : class
            where TProperty : class, IEnumerable
        {
            TokenValueFactory <T, TProperty> tokenValue = Conditionals.Property <T, TProperty>();

            return(configurator.CreateNode(id => new EachNode <T, TProperty, TElement>(id, tokenValue, elementMatch)));
        }
        public static PropertyNode <T, TProperty, TValue> Property <T, TProperty, TValue>(
            this RuntimeConfigurator configurator, PropertyInfo propertyInfo,
            PropertySelector <TProperty, TValue> propertySelector)
            where T : class
        {
            PropertyNode <T, TProperty, TValue> propertyNode = configurator.CreateNode(
                id => new PropertyNode <T, TProperty, TValue>(id, propertyInfo, propertySelector));

            return(propertyNode);
        }
        public static PropertyNode <T, TProperty> Property <T, TProperty>(
            this RuntimeConfigurator configurator, Expression <Func <T, TProperty> > propertyExpression)
            where T : class
        {
            PropertyInfo propertyInfo = propertyExpression.GetPropertyInfo();

            PropertyNode <T, TProperty> propertyNode =
                configurator.CreateNode(id => new PropertyNode <T, TProperty>(id, propertyInfo));

            return(propertyNode);
        }
예제 #11
0
        Activation CreateMissingAlphaNode <T>(Type type)
            where T : class
        {
            AlphaNode <T> alphaNode = _configurator.CreateNode(id => new AlphaNode <T>(id));

            foreach (Type nestedType in GetActivationTypes(typeof(T)))
            {
                _initializers[nestedType].AddActivation(this, alphaNode);
            }

            return(alphaNode);
        }
        public static CompareNode <T, TProperty> LessThanOrEqual <T, TProperty>(this RuntimeConfigurator configurator,
                                                                                TProperty value)
            where T : class
            where TProperty : IComparable <TProperty>
        {
            Value <TProperty> rightValue = Conditional.Constant(value);
            TokenValueFactory <T, TProperty> tokenValue = Conditional.Property <T, TProperty>();

            var comparator = new LessThanOrEqualValueComparator <TProperty>();

            return(configurator.CreateNode(id => new CompareNode <T, TProperty>(id, tokenValue, comparator, rightValue)));
        }
        public static Activation <T> Property <T, TProperty>(this RuntimeConfigurator configurator,
                                                             PropertyInfo propertyInfo)
            where T : class
        {
            PropertySelector propertySelector = configurator.GetPropertySelector(propertyInfo);

            Type propertyNodeType = typeof(PropertyNode <, ,>)
                                    .MakeGenericType(typeof(T), propertySelector.PropertyType, propertySelector.ValueType);

            return(configurator.CreateNode(
                       id => (Activation <T>)Activator.CreateInstance(propertyNodeType, id, propertyInfo, propertySelector)));
        }
        public static ConditionNode <Token <T1, T2> > Condition <T1, T2>(
            this RuntimeConfigurator configurator, Predicate <T2> condition)
            where T1 : class
        {
            ConditionNode <Token <T1, T2> > conditionNode = configurator.CreateNode(
                id => new ConditionNode <Token <T1, T2> >(id, (value, next) =>
            {
                if (condition(value.Item2))
                {
                    next();
                }
            }));

            return(conditionNode);
        }
 public static DelegateProductionNode <T> Delegate <T>(this RuntimeConfigurator configurator,
                                                       Action <Session, T> callback)
     where T : class
 {
     return(configurator.CreateNode(id => new DelegateProductionNode <T>(id, callback)));
 }
 public static ConstantNode <T> Constant <T>(this RuntimeConfigurator configurator)
     where T : class
 {
     return(configurator.CreateNode(id => new ConstantNode <T>(id)));
 }
 public static AlphaNode <Token <T1, T2> > Alpha <T1, T2>(this RuntimeConfigurator configurator)
     where T1 : class
 {
     return(configurator.CreateNode(id => new AlphaNode <Token <T1, T2> >(id)));
 }
예제 #18
0
 ValueNode <T, TProperty> CreateValueNode(TProperty value)
 {
     return(_configurator.CreateNode(id => new ValueNode <T, TProperty>(id, value)));
 }
 public static LeftJoinNode <T1, T2> Left <T1, T2>(this RuntimeConfigurator configurator,
                                                   RightActivation <T1> rightActivation)
     where T1 : class
 {
     return(configurator.CreateNode(id => new LeftJoinNode <T1, T2>(id, rightActivation)));
 }
 public static JoinNode <T> Join <T>(this RuntimeConfigurator configurator, RightActivation <T> rightActivation)
     where T : class
 {
     return(configurator.CreateNode(id => new JoinNode <T>(id, rightActivation)));
 }