title: ?? and ternary operations with Bool? and Guid? types
body: <p>I am trying to check the state of an object, if it is null then I need to return null, otherwise, I need to return a <code>Guid</code> or a <code>Bool</code>.</p>
  
  <pre><code>Portrait_Enabled = _SiteImagesModel_ImagesViewModel == null ? null : _SiteImagesModel_ImagesViewModel.Enabled,
  Portrait_PrimaryImage = _SiteImagesModel_ImagesViewModel.PrimaryImage ?? null,
  Portrait_RecordID = _SiteImagesModel_ImagesViewModel.RecordID ?? null,
  Portrait_RelatedImage = _SiteImagesModel_ImagesViewModel.RelatedImage ?? null,
  </code></pre>
  
  <p>I have tried both the <code>??</code> and the <code>? :</code> and I get a compiler error stating:</p>
  
  <blockquote>
    <ul>
    <li>Type of conditional expression cannot be determined because there is no implicit conversion between <code>&lt;null&gt;</code> and <code>bool</code></li>
    <li>Operator <code>??</code> cannot be applied to operands of type <code>bool</code> and <code>&lt;null&gt;</code></li>
    <li>Operator <code>??</code> cannot be applied to operands of type <code>Guid</code> and <code>&lt;null&gt;</code></li>
    </ul>
  </blockquote>
  
  <p>Both the <code>Guid</code> and <code>Bool</code> values are <code>Nullable</code>.</p>