苏木清华

--一些小记录

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2010年10月18日

摘要: Method1method1=()=>{inti=4;i+=6;};Method2method2=i=>{i++;i+=6;};Method3method3=(x,y)=>{x++;y++;returnx+y;};publicdelegateboolFilter(intnum);Filterfilter=i=>{return(i&1)==0;};Filterfilt... 阅读全文
posted @ 2010-10-18 12:52 苏木清华 阅读(102) 评论(0) 推荐(0)

摘要: 如果要查询 IEnumerable<Customer>,则输入变量将被推断为 Customer 对象,这意味着您可以访问其方法和属性:customers.Where(c => c.City == "London"); 阅读全文
posted @ 2010-10-18 12:21 苏木清华 阅读(178) 评论(0) 推荐(0)

摘要: Lambda 语句的主体可以包含任意数量的语句;但是,实际上通常不会多于两个或三个语句。 阅读全文
posted @ 2010-10-18 12:19 苏木清华 阅读(327) 评论(0) 推荐(0)

摘要: 所有 Lambda 表达式都使用 Lambda 运算符 =>,该运算符读为“goes to”。该 Lambda 运算符的左边是输入参数(如果有),右边包含表达式或语句块。Lambda 表达式 x => x * x 读作“x goes to x times x”。可以将此表达式分配给委托类型,如下所示:delegate int del(in... 阅读全文
posted @ 2010-10-18 10:41 苏木清华 阅读(185) 评论(0) 推荐(0)

摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebApp{ public partial class ExFunction : System.Web.UI.P... 阅读全文
posted @ 2010-10-18 10:12 苏木清华 阅读(114) 评论(0) 推荐(1)