Monday, September 29, 2008

C# Automatic Properties

Using auto properties reduces the boilerplate code quite a bit, but I didn't realise you can restrict the setter by adding 'private' like this:

public string MyProperty { get; private set; }

No comments: