Properties can be made read-only by having only a get accessor in the implementation.
public class X
{
public X(int id)
{
_id = id;
}
public int ID
{
get
{
return_id;
}
}
}
public class X
{
public X(int id)
{
_id = id;
}
public int ID
{
get
{
return_id;
}
}
}