title: ASP.net MVC CheckBoxFor casting error
body: <p>I have a EF entity that is tied to a SQL table that contains a bit field called "Active".  I generate the Edit code from the T4 template, and the page inherits from the EF entity.  At the bottom of the page, it generated a CheckBoxFor like this:</p>
  
  <pre><code>&lt;%= Html.CheckBoxFor(model =&gt; model.Active) %&gt;
  </code></pre>
  
  <p>I get the wonderful red squiggly under model.Active, and the error message says that I cannot implicitly convert type bool? to bool.  So, I tried the following:</p>
  
  <pre><code>&lt;%= Html.CheckBoxFor(model =&gt; (bool)model.Active) %&gt;
  </code></pre>
  
  <p>It, of course, didn't like that and gave me this error:</p>
  
  <blockquote>
    <p>System.InvalidOperationException:
    Templates can be used only with field
    access, property access,
    single-dimension array index, or
    single-parameter custom indexer
    expressions.</p>
  </blockquote>
  
  <p>I'm probably missing something simple.</p>