您的位置:首页 > Web前端

C#3.0高级特性 New C#3 Language Features

2010-12-18 16:36 239 查看
1.Linq
2.Extension Methods
3.Lambda Methods

string [] names=new string[]{"bill","Jane","Bob"};

IEnumberable<string> bs=name.Where<string>(
deletegate(string s){ return s.StartWith("b"); }
);

等同于: IEnumberable<string> bs=names.Where( n => n.StartWith("b") );

4.Generic Type Inference
5.Automatic properties
6.Object and Collection Initializers
7.Type Inference 类型推断
e.g.: var now=new DateTime(2001,1,1); // The variable takes the type Datetime
8. Anynymous Types 匿名类型.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: