using System;
using System.Linq.Expressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//表达式创建
Expression<Func<int, int>> zz = m => m + 1;
//将表达式编译
Func<int, int> foo = zz.Compile();
//获取返回结果
int result = foo(9);
Console.WriteLine(result.ToString()); //output: 10
Console.ReadKey();
}
}
}