nullable types to object
<p>Using dotnet 2.0. Can the following code be improved in style ?</p>

<pre><code> private object GetObj_Version1(int? num)
 {
  return num ?? (object)DBNull.Value;
 }
</code></pre>

<p>The cast looks a bit messy to me.
Version2 below avoids the cast, but its long winded : </p>

<pre><code>    private object GetObj_Version2(int? num)
 {
  object numObj;
  if (num.HasValue)
   numObj = num.Value;
  else
   numObj = DBNull.Value;

  return numObj;
 }
</code></pre>

<p>Can you think of an alternative which is both short and avoids the cast ? TIA.</p>
