Friday, March 07, 2008

I've just come across this in Visual Studio 2008.

 

Rather than typing a long winded property definition.

 

private int age=0;

public int Age
{
  get
  {
    return age;
  }
set
{
     age=value;
}
}

You now can just type

public int Age {get; set;}

Friday, March 07, 2008 12:13:57 PM UTC  #    Comments [1]  | 
Sunday, March 30, 2008 10:05:45 PM UTC
C# 3.0 syntax, great isn't it ;)
Simon Hart
Comments are closed.

Theme design by Jelle Druyts

Pick a theme: