Private set property - public get, private set

Adam K Dean - Dec 29 '10 - - Dev Community

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;  }
Enter fullscreen mode Exit fullscreen mode

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

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player