Question about expression: a ? b : c
<p>I tried to use the following example codes by using a ? b : c expression:</p>

<pre><code>DateTime? GetValue(string input)
{
  DateTime? val = string.IsNullOrEmpty(input) ? null : DateTime.Parse(input);
  return val;
}
</code></pre>

<p>I got compiling error since in the a ? b : c expression because b and c are different data types; Not sure if I can use (DateTime?) case to c part?</p>

<pre><code>  DateTime? val = string.IsNullOrEmpty(input) ? null : (DateTime?) DateTime.Parse(input);
</code></pre>

<p>I would rather not use if to split this one into two or three statement.</p>
