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

 

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 匿名类型.

 

posted @ 2010-12-18 16:36  庚武  Views(190)  Comments(0Edit  收藏  举报