예제 #1
0
    public void LambdaExpression <T1, T2>(BinaryExpressionRoot root, Node <T1> nOne, Node <T2> nTwo)
    {
        MemberExpression one = Expression.Property(Expression.Constant(nOne, typeof(Node <T1>)), nameof(Node <T1> .Value));
        MemberExpression two = Expression.Property(Expression.Constant(nTwo, typeof(Node <T2>)), nameof(Node <T2> .Value));

        var some = Expression.Lambda(Expression.Add(one, two));

        Func <int> oneThreeHill = (Func <int>)some.Compile();

        Debug.Log(oneThreeHill());
    }
예제 #2
0
 public void BinaryExpression <T1, T2>(BinaryExpressionRoot root, Node <T1> one, Node <T2> two)
 {
     BinaryExpression exp = Expression.MakeBinary(ExpressionType.Add, Expression.Constant(42, typeof(int)), Expression.Constant(12, typeof(int)));
     //Funk<int, int, int> some = exp.
 }