Skip to Content
Microsoft® Visual Studio® 2010 Unleashed
book

Microsoft® Visual Studio® 2010 Unleashed

by Mike Snell, Lars Powers
August 2010
Intermediate to advanced
1224 pages
34h 17m
English
Sams
Content preview from Microsoft® Visual Studio® 2010 Unleashed

Create an Automatically Implemented Property (New for VB)

Beginning with the 2008 version, C# allows for a simplified property declaration called auto-implemented properties. With this feature, you can declare a property without having to declare a local, private field to back the property. Instead, the compiler does this for you. This can be useful when you do not need logic inside the property’s assessors. This feature has been added to VB for the 2010 version.

As an example, suppose you want to define the property Name on the Employee class. You can declare this property without setting a private field variable as shown here:

C#

public string Name { get; set; }

VB

Public Property Name As String

Notice that there is no logic in the get or set ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Visual Studio® 2012 Unleashed, Second Edition

Microsoft® Visual Studio® 2012 Unleashed, Second Edition

Mike Snell, Lars Powers
Professional Visual Studio® 2008

Professional Visual Studio® 2008

Nick Randolph, David Gardner
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9780132121057Purchase book