<p>If I have a property that I want to let inheritors write to, but keep readonly externally, what is the preferred way to implement this? I usually go with something like this:</p>

<pre><code>private object m_myProp;
public object MyProp
{
    get { return m_myProp; }
}
protected void SetMyProp(object value)
{
    m_myProp = value;
}
</code></pre>

<p>Is there a better way?</p>

```
```
private object m_myProp;
public object MyProp
{
    get { return m_myProp; }
    protected set { m_myProp = value; }
}
```
```
Or in C# 3.0
```
```
public object MyProp {get; protected set;}
```
```