// 一个 TDelegate 类型的委托,它表示由 System.Linq.Expressions.Expression`1 描述的已编译的 lambda 表达式。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace ExpressionFunc
{
class Program
{
static void Main(string[] args)
{
Expression<Func<int, bool>> expression = x => x < 200;
Func<int, bool> func = expression.Compile();
bool isok = func(50);
Console.WriteLine(isok);
isok = func(500);
Console.WriteLine(isok);
Console.Read();
}
}
}