Skip to content

History

Kota edited this page Feb 8, 2019 · 8 revisions

C#

1.0 (2002)

  • Hello, World!

2.0 (2005)

  • Generic

3.0 (2007)

  • cs => cs.Linq

4.0 (2010)

  • dynamic

5.0 (2012)

  • async

6.0 (2005)

  • Auto Property Initializer
public Guid Id { get; } = Guid.NewGuid();
  • Primary Constructor
  • using Static Typename
using System.Console;
class Program
{
  public static void Main()
  {
    WriteLine("Hello World!");
  }
}
  • Dictionary Initializers
var _users = new Dictionary<string, string>() { 
  ["admin"] = "Ram",
  ["guest"] = "Sham"
}
  • Numeric Literals
public byte Code { get; } = 0b1100;
public long Length { get; } = 1_000_000_000;
  • Declaration Expression
foreach (var n in var odd = numbers(n +. n %2 == 1).ToList())
{
}
  • Await in Catch block

Clone this wiki locally