What benefit is there in wrapping a simple type in a class?
<p>I am looking at code that is essentially passing an id around, for example:</p>

<pre><code>GetPersonById(int personId)
</code></pre>

<p>But instead of using an int, it used a PersonId object.</p>

<pre><code>GetPersonById(PersonId personId)
</code></pre>

<p>The PersonId object is just an int with some hand-cranked code to make it nullable. So was this created in old .NET when nullable ints weren't available or is there a higher purpose for wrapping simple types in a class?</p>

<pre><code>public sealed class PersonId {

    private PersonId() {
        _isNull = true;
        _value = 0;
    }


    private PersonId(int value) {
        _isNull = false;
        _value = value;
    }

    // and so on!
}
</code></pre>
