Adam K Dean

Private set property - public get, private set

Published on 29 December 2010 at 21:51 by Adam

Just come across something I haven't needed before, a property read-only from the outside, but writeable from the inside.. I present to you the private set property!

public SocketException LastErrorException { get; private set;  }

You can set it from within the class, but not from outside. Simple!



This post was first published on 29 December 2010 at 21:51. It was filed under archive with tags csharp.