title: using ?? operator for string null or empty and DBNull.Value
body: <p>I  want the following logic to be a one liner , </p>
  
  <pre><code>string CastString(String str)
  {
      if (string.IsNullOrEmpty(str))
      {
         return DBNull.Value.ToString();
      }
      else 
      {
          return str;
      }
  }
  </code></pre>
  
  <p>what I tried is  </p>
  
  <pre><code>string.IsNullOrEmpty(str) ? DBNull.Value : str
  </code></pre>
  
  <p>is there a way to use the ?? operator for this , what I tried is </p>
  
  <pre><code>return str ?? DBNull.Value 
  </code></pre>
  
  <p>but this does not work</p>