Monday, March 05, 2007
I was looking at Ander's slides from Tech Ed Europe and he had one about automatic properties but watching the video he did not cover that in his session. It is the simplest concept imaginable and hence it deserves a simple short blog entry.
In C#3, you can write code like this:
Get the March CTP to try it out yourself.
In C#3, you can write code like this:
public string NameThe compiler generates code like this:
{
get;
set;
}
private string XX;, where XX is not directly accessible to you in code of course. This only works for properties with both getter and setters.
public string Name
{
get { return XX; }
set { XX = value; }
}
Get the March CTP to try it out yourself.
Labels: Orcas
Copyright © Daniel Moth


