title: c# assign string value based on bool value which can be nullable
body: <p>Here is my code:</p>
  
  <pre><code>    stringValue = microData.BoolValue.HasValue ? "True" : "False";
  </code></pre>
  
  <p>What I am trying to do is assign a stringvalue based on a Boolvalue.
  if BoolValue has a value I like to do the following:</p>
  
  <p>Assign stringValue = "True" if BoolValue is true.
  Assign stringValue = "False" ib BoolValue is false.</p>
  
  <p>If Boolvalue does not have a value, assign it to null. </p>
  
  <p>What i have above does not seem to work. </p>