C# 3.0: Auto-Implemented Property
Tired of writing this?
private int id;
public int Id
{
get
{
return this.id;
}
set
{
this.id = value;
}
}
Fear not! C# 3.0 will give way to a new structure for simple getter setter. The above code will become...
public string Test { get; set; }
Amazing!
Behind the scene, the compiler will generate an anonymous type as the backing field, and create getter/setter code as usual. Now what's anonymous type? Well, that's another question for another day!