new features in each version of c#

类别: C# 查看评论

Each version of C# has a number of new features and generally a major theme. The major themes have been generics and nullable types in C# 2.0, LINQ in C# 3.0, and dynamic types in C# 4.0.

The major features added in each release are generally considered to be the following:

  1. C#1.0/.Net1.0/vs2002
  2. C#1.2/.Net1.1/vs2003
  3. C# 2.0/.Net2.0/vs2005
    • Generics (framework support was added, and C# benefited from this);
    • Iterator pattern (the yield keyword);
    • Anonymous methods (the delegate keyword),
    • Nullable types, and the null coalescing operator (??). 
  4. .Net3.0
  5. C# 3.0/.Net3.5/vs2008
    • Anonymous types,
    • Extension methods,
    • Object initializers, collection initializers,
    • Implicitly typed local variables (var keyword),
    • Lambda expressions (=>),
    • LINQ query expression pattern. 
  6. C# 4.0/.Net4.0/vs2010
    • Optional and Named Arguments
    • Dynamic typing (dynamic type)
    • Improved COM-Interop
    • Contra and Co-Variance.

发表评论