C#高级特性
- var 隐式数据类型,由初始值决定类型
- var name = new {} 匿名类型
- delegate 匿名函数
例:delegate in add(int x,int y)
调用:add a = delegate(int x,int y){return};
拓展方法:(静态修饰)public static int mystrcount(this string str){return} - yield关键字
例:public static IEnumerable 名称(this string str){yieid return}
将返回值转为枚举集合 - lambda表达式
=> goes to
形参列表=>方法体
例:list< gird > list = l.where(a=>a.id=2).tolist();