万物只要有开始,就必有结束
Program.cs
class Program { static void Main(string[] args) { Expression> expression = (a, b) => a + b; Console.WriteLine("这是表达式主体{0}", expression.Body); Console.WriteLine("这是实际表达式{0}", expression); //int d = expression(3, 5); Func function = (a, b) => a + b; Func function2 = (a,b) => (a < b); Expression > Expression2 = (a, b) => (a < b); Console.WriteLine("这是expression2的主体{0}", Expression2.Body); Expression > lessThan = i => i < 5; Console.WriteLine(lessThan); Console.WriteLine("表达式的结果{0} ", lessThan); Expression > plusEquals = (a) => (a+a); Console.WriteLine("这是plusEqual的主体{0}", plusEquals.Body); Console.WriteLine(plusEquals); //Int32 c = plusEquals(3); int c = plusEquals.Compile()(3); Console.WriteLine("这里是plusEquals表达式的结果{0}", c); //我想在这里做一个sql查询 //var query = from cus in db.Customers where cus.City == "Nantes" select new { cus.City, cus.CompanyName }; Console.ReadLine(); } }