Ejemplo n.º 1
0
        public void ExpressionTreeModifyToAdd()
        {
            ExpressionTreeExample ete = new ExpressionTreeExample();
            Func <int, int>       add = ModifyExpressionTree(ete.BuildExpressionTrees <int>());

            Console.WriteLine(add(5));
        }
Ejemplo n.º 2
0
        public void ExpressionTreeMultiply()
        {
            ExpressionTreeExample         ete   = new ExpressionTreeExample();
            Expression <Func <int, int> > eTree = ete.BuildExpressionTrees <int>();
            Func <int, int> compileTree         = eTree.Compile();

            Console.WriteLine(compileTree(5));
        }
Ejemplo n.º 3
0
        public void IsAdultFemale()
        {
            Person p = new Person {
                Age = 19, Gender = "female", Hot = true
            };
            ExpressionTreeExample ete = new ExpressionTreeExample();

            Console.WriteLine(ete.IsAdultFemale(p));
        }