I\'ve seen a lot of example code written using something like (please forgive how horribly canned this is):
public class Test
{
public object Thingy { get; pr
Basically, it is a readonly property. If it was written in full (not as an auto property) you would simply leave out the setter.
Two examples that are largely the same:
class Foo1
{
public int Id { get; private set; }
public Foo1()
{
Id = lastId ++;
}
}
class Foo2
{
private int _id; // could be readonly
public int Id { get { return _id; } }
public Foo2()
{
_id = lastId ++;
}
}