About Me

Training

Develop With Passion® - Developer Bootcamp

Subscribe

Automatic Properties - In case you didn't know

Written February 20, 2008 at 07:25 MST Tagged c sharp

The following snippet of code (C# 3.5) is allowable, and gives you the benefit of unnecessary extra verbosity with the benefits of encapsulation. Of course, if you need to implement logic in your property, then you don't want to think about automatic properties:
public T Item { get; private set; }